I'm trying to use jQuery and Flexigrid to display a table. Once the table is displayed, I want to be able to use the page up/page down keys to scroll down the table.
I've tried using offsetTop and offsetParent but it's not working. The values are being set as expected, but the scrollbar isn't moving. Here is the JS code <code> var inum = 1; function scrollDown() { var bDiv = $('.bDiv'); //alert("Point: " + document.getElementById("point20").offsetTop + "\n" + // "ID: " + document.getElementById("point20").className + "\n" + // "jQ: " + $("#point20").attr("id")); var j = 'point' + inum.toString(); var thepoint = document.getElementById(j).offsetParent; if(inum <= 199 && inum >= 0) { alert("incrementing scrollTop"); bDiv.scrollTop = parseInt(inum) * 5; //thepoint; inum++; } alert("Height: " + bDiv.scrollHeight); /** alert("Top: " + bDiv.scrollTop + "\n" + " I: " + inum + "\n" + " J: " + j + "\n" + "Point: " + thepoint + "\n" + "Parent: " + bDiv.offsetParent + "\n" + "Parent2: " + thepoint.offsetParent); ***/ //if(i==6) i=1; //alert("Span Value: " + j + " - " + $("#" + j).attr("id") + "\n" + " - POINT: " + thepoint); //alert("Top: " + bDiv.scrollTop); //alert("Scroll: " + bDiv.outerHeight(true) + " - " + bDiv.innerHeight(true)); //bDiv.scrollBy(150,150) } </code> Each row has a cell with the following: <span name="pointX" id="pointX" class="classforcell"> .... </span> I've been all over this code and can't figure out why it won't work, outside of me doing something wrong. Maybe I just need to take a break. Any help would be GREATLY appreciated.