View Single Post
Old 12-17-2012, 04:44 PM   PM User | #6
kraftomatic
Regular Coder

 
Join Date: Jul 2003
Posts: 600
Thanks: 17
Thanked 0 Times in 0 Posts
kraftomatic is an unknown quantity at this point
Okay, thanks so far guys. With using old-school Javascript, window.hash doesn't work in IE7 which is a problem. So I'm trying to do this in Prototype now (still can't use jQuery). I have a function that will scroll on click, but I can't get it working dynamically when the page loads. Does anyone see what I might need to make this work?

Code:
Event.observe(window, 'load', function() {
	$$('a[href^=#]:not([href=#])').each(function(element) {
		element.observe('click', function(event) {
			new Effect.ScrollTo("newID_1");
			Event.stop(event);
		}
		.bindAsEventListener(element))
	})
})
Thanks a bunch for any suggestions.
kraftomatic is offline   Reply With Quote