i was using this :
var divID=this.id;
document.getElementById(divID).scrollIntoView();
highlightFor(divID,"#F3F781",2)
it worked perfectly. However now i have the event handlers (divs) inside another divs which overflow with a scrollbar on the x axis. So now when i click on the div that should fire the JavaScript above, the overflow scroll bar just scrolls down a bit.
I have put an alert in to check the id, it is fine. This fires on click, however the functionality of scrollIntoView(); is not working. when i alert the whole line , it comes up as “undefined”?
any help here?
Thanks;
structure:
All divs that fire the function are contained within a single div – call it Summary Div.
when there are a lot of results the summary div has an overflow-y scroll bar. This summary div is appeneded to a wrapper Div, which also contans a title DIv,. When i click on a div that fires the function the page should scroll down to the div with the results that has the same id and animate it. However this is not the case. The y-overflow Scroll bar simply scrolls down a bit
Sorry guys, there was a simple mistake in the DOM elements. I had assigned an ID Twice