Page 1 of 1

Getting a div to act like iFrame

Posted: Sat May 30, 2009 12:52 am
by Shaneckel
Greetings forum, It's been a while since I've posted (Since AS3 has consumed my life) but I have question I hope you intelligent people can help me with.

I have two divs nested in a 400 x 500 div. the left div contains a list of pages that will be loaded in the right div. Both divs scroll when it becomes too big for the containing divs height. Works great by passing a variable with php and refreshing the page, BUT...

The users location on the scrolling list in the left div resets (Rightfully so because you are loading a new page). Now, is there a way to save how far you scrolled in pass it onto the new page? Or should I just change the right div to a iFrame and avoid this problem? Even though I really have a distaste for iFrame.

Any thoughts?

thanks,

Shane

Re: Getting a div to act like iFrame

Posted: Sat May 30, 2009 1:08 am
by mikemike
Hmm, interesting problem.

I've never tried it, but one way of checking may be to assign each entry in the div an id and anchor it:

Code: Select all

<a name="unique_id_83587"></a>
and then link to it (page.php?your=query&string=here#unique_id_83587). It might be that the div scrolls too. Worth a shot and it's easy to test. :)

Re: Getting a div to act like iFrame

Posted: Mon Jun 01, 2009 2:43 pm
by Shaneckel
That's really clever.

I was hoping that there was a way to maintain the visual position so it didn't look like it changed. Maybe I could pass the position of the scroll bar along and then change it when the page loads.

Thanks for the help.