Reputation: 1341
I'm using jquery and my code is like this:
$(window).scroll(function(){
var bottom = $("div#theid").offset();
if ( bottom.top - $(window).scrollTop() < 650 ) {
//do something here
}
});
so when scroll down the browser, will do something, this works just fine on desktop browser, but not on mobile browser, but if I rotate my phone , this code will work, very strange. Why this strange thing happen? Thank you!
Upvotes: 0
Views: 80
Reputation: 95
Because when you rotate your phone, the var buttom
variable changes which effects jQuery to function.
Upvotes: 1