[thelist] Conditional Scrolling Sidebar

Ben Dyer radicalbender at gmail.com
Wed May 28 11:00:53 CDT 2008

Really stumped and I have people breathing down my neck, so hopefully
this can be fixed.

First, here's the page I'm working on:


Here's the issue.  I've been utilizing the code for conditionally
sticky sidebar as seen at:


It works perfect in Firefox and Safari, but the problem is (of
course), Internet Explorer.

In IE7 (which the script is supposed to work in), it scrolls, but
shifts all of the div contents to the center, overlapping the contents
of the form.  I figured this probably has to do with the fact that
it's not aligned with the edge of the window, but how can I fix this?

In IE6, it's not designed to work, but is there *ANY* way to make it
at least appear to do the same thing?  I still have to support that
awful browser.

Here's the code.  Can anybody help?

	window.onscroll = function() {
		if (window.XMLHttpRequest) { // IE 6 doesn't implement position
fixed nicely...
			if (document.documentElement.scrollTop >= 269 || self.pageYOffset >= 269) {
				$('scrolly').style.position = 'fixed';
				$('scrolly').style.top = '0';
			} else if (document.documentElement.scrollTop < 269 ||
self.pageYOffset < 269) {
				$('scrolly').style.position = 'absolute';
				$('scrolly').style.top = '269px';


Radical Bender

More information about the thelist mailing list