Hi all, I am implementing a scrolling div class for my ecommerce store. I wanted to make it so the div stops scrolling right above the footer (so it doesn't overlap) and stays there until the user scrolls back up. This is the code I started with but it doesn't seem to be working. Any help would be appreciated jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > 124 ) { jQuery('#object-scroll').addClass('scroll-fixed'); if (jQuery(this).scrollTop() > jQuery(window).height() - 289) { jQuery('.scroll-fixed').css('bottom','330'); } } else { jQuery('#object-scroll').removeClass('scroll-fixed'); } }); Code (JavaScript):
Yeah, without seeing what that's being applied to it's hard to weigh in too meaningfully, but it almost sounds like you are doing something that has no business being done on a website -- using either a massive scripting animation to automatically have a box marquee scroll 1990's style (I fell into that trap when I first started out with websites thanks to scam artist hellhouses like dynamic drive) or using JS to control user scrolling. But really the moment I even see jQ on a site these days I assume it's either something that should be CSS job or does not even belong on a website in the first place. If it's normal page scrolling why does it need JS... if it's automatic scrolling why would the footer placement even be involved?
Check out this jsfiddle: http://jsfiddle.net/FDv2J/1913/ Facebook's sidebar is doing something similar, I believe.