Getting a div to act like iFrame

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
Shaneckel
Forum Commoner
Posts: 48
Joined: Fri Sep 23, 2005 3:46 am
Location: Pittsburgh, PA

Getting a div to act like iFrame

Post 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
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: Getting a div to act like iFrame

Post 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. :)
Shaneckel
Forum Commoner
Posts: 48
Joined: Fri Sep 23, 2005 3:46 am
Location: Pittsburgh, PA

Re: Getting a div to act like iFrame

Post 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.
Post Reply