If you visit this website and scroll down the page, you will see that the right panel with shopping and categories moves along with you...
The script I am using for this functionality is:
$(function () {
var btn = $('.scroll');
var btnPosTop = btn.offset().top;
var win = $(window);
win.scroll(function (e) {
var scrollTop = win.scrollTop();
if (scrollTop >= btnPosTop) {
btn.css({ position: 'fixed', top: 10, marginTop: 0, 'z-index': 1, width: '260px'});
} else if (btn.css('position') === 'fixed') {
btn.css({ position: '', top: '', marginTop: '0px', 'z-index': 0 });
}
});
});
Everything works well except for one issue - in IE 9, the div disappears while scrolling down (it's still there but not visible).
I have tried using z-index
in the script above to solve the problem, but it hasn't helped.
Do any of you have a suggestion for a solution?