New IE Scrolling JavaScript
I’d really like some feedback on the latest IE6 feature push. The previous Javascript based method of placing Hab.la in a window seemed a bit jumpy, and not really that responsive. I rewrote the JavaScript that causes Hab.la to stay in the corner as you scroll your web-page. Now Hab.la will follow you around in a much smoother fashion. Let me know what you guys think of this.
IE6 has some limitations, but we try our best to mitigate them :-).
A little bit more detail on the problem: Essentially Hab.la can’t float in the corner in IE6 because IE6 does not support FIXED positioning. I.e. unlike IE7, Firefox, Opera, and Safari IE doesn’t support the position: fixed CSS tag. There are many methods of mitigating this problem, including many CSS Hacks. We wanted to stay away from CSS Hacks, which require a separate CSS file because we couldn’t depend on the CSS styles rendering for all the dynamic DOM content in Hab.la.
If you a search on Google you’ll notice this is a pretty common problem. In any case, the old method was to update the position of the Hab.la div whenever you scrolled, or resized the window. This created really choppy transitions when users were doing a lot of scrolling, but more closely mocked up fixed:position.
In the new method, which I adapted from http://www.codingforums.com/showthread.php?p=637753 Instead of monitoring events such as window.onscroll or window.resize. We just monitor the window every 500ms to see if we need to change the location of the Hab.la DIV. When a change is necessary, instead of immediately moving the div to the correct location, we smoothly move the div the desired location exponentially approaching the desired X,Y coordinates. [The above is pretty much what I found in coding forums, but the guy writing that post definitely didn’t write his code so it could be read by others – and has some extra steps that aren’t really necessary.]
In short, IE6 users, please let me know if you think the smooth fixed positioning via JavaScript is a useful improvement.

Comments [0]