I have a page which loads dynamic content inside a modal popup box called TINY box. The content is generated only when the respective links are clicked. I then have a variable called var innerhtml = "<div id ='"+d.name+"'>
which generates divs inside the modal box.
where d.name is a variable that dynamically produces a value based on my data. This div is inside the main modal box div which is generated and destroyed whenever the user opens the link and closes the box.
Infact even the box is generated on-the-fly:
var innerhtml2 = "<div id ='box'>
But WHILE the box is open, I want the box to autoscroll to a particular div (based on the ids I've mentioned above).
I tried ScrollTop, ScrollTo and Scrollintoview - but I haven't had any luck because the modal box is created and destroyed on the fly and I've read around that those functions work only once the page is fully loaded. Is it possible to write a program that can automatically scroll a dynamically generated modal box to dynamically generated divs inside it?
So how can I do this? Do you need code snippets?
Thanks in advance!
Kaushik