Well as with most things, what at first appeared to be perfect, was not at all.
My JS needed some serious re-working in order to get IE to play nice, and I needed to change the functions to wait until the scrolling had stopped. Had to practically rewrite the code from scratch.
Here is the finished javascript
:
var scrollTimer = -1;
function bodyScroll() {
if (scrollTimer != -1)
clearTimeout(scrollTimer);
scrollTimer = window.setTimeout("scrollFinished()", 500);
}
function scrollFinished() {
var currentPos = $(window).scrollTop() + 10;
if (currentPos>200){
var nowTop = (currentPos-120) + "px";
} else {
var nowTop = 0 + "px";
}
$("#right-bar").animate(
{ top: nowTop }, {
duration: 500,
easing: 'swing'
});
return false;
}
window.onscroll = bodyScroll;
Now it appears to be working in all browsers, and it is much less resource intensive. I still may be getting some lag issues if you sit on the page for a while, but I can't completely confirm that yet. Time for some sleep.
If you feel like testing it for me, the link again is:
http://trainingpen.com/home.php?cat=105