Reputation: 448
I've made a small jQuery code, which works on Chrome and Opera, but not on IE and Firefox.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js">
$(document).scroll(function () {
if ($('body')[0].scrollTop / $('body')[0].scrollHeight > 0.29) {
$(".over_one").fadeIn(2000);
} else {
$(".over_one").fadeOut(1);
}
});
</script>
Upvotes: 3
Views: 267
Reputation: 8410
I think you have a src
attribute and javascript code inside the script tag. This should be separated into 2 script tags.
Generally what you posted is written as: (though that may not be the problem)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
$(document).ready(function () {
if ($('body')[0].scrollTop / $('body')[0].scrollHeight > 0.29) {
$(".over_one").fadeIn(2000);
} else {
$(".over_one").fadeOut(1);
}
});
</script>
Upvotes: 1