:: Forum >>

trapping OnScroll events

I was wondering if there is a way to trap the onScroll event?
I need to simulate "frozen" columns (colums that stay anchored to the left as the rest of the grid scrolls under) and come really close by creating the frozen colums in a separate div that sits next to the main grid. I am however having a tough time trapping the onScroll event, and the vertical offset (scrollTop) of the ActiveWidgets grid so that I can move the div with the frozen cols when the main grid moves. I only need support for IE 5+ if that helps.
Any thoughts on how to do this???
Thanks!

Great work by the way! By far the best framework I have come across.
Jim
Wednesday, January 21, 2004
You need something like this:

// get access to the scrollbars DIV
var scrollbars = obj.getTemplate("layout").getContent("scrollbars");

// save original event handler
var defaultScroll = scrollbars.getEvent("onscroll");

// create new one
var myScroll = function(){
// call the original handler first
defaultScroll.call(this);
// do my stuff
window.status = scrollbars.element().scrollTop;
}

// assign new handler
scrollbars.setEvent("onscroll", myScroll);


Look at the file /source/lib/templates/scroll.js for more hints
Alex (ActiveWidgets)
Wednesday, January 21, 2004

This topic is archived.


Back to support forum

Forum search