Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layout Deign Qustion

Status
Not open for further replies.

DarkKodiak

Programmer
Feb 2, 2003
15
US
If I use layers on my page say for my top navigation menu, can I use javacript or html to just change the content under the top navigation menu?

For example,
In this site, if I click on say Classifieds>Personal, only the bottom content changes, how do they do this? DO they jus reload the top nav on the newly requested page? How can I do something like this?
 
As far as I can tell, the whole page reloads. You may not see it because of browser caching.

However, you could achieve what you want by using an invisible frame and copying the source to a layer. I've done this before to update only particular layers of a page. Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 
Invisible frame?? Can you explain...first time I heard of such a thing.
 
It's a frameset where one frame is 100% of the screen, and another frame is set to "0". The zero frame is invisible. Open content in there, and you can script the content from that into a layer in the visible frame. As far as the user is concerned, the layer is updating itself without the page reloading, while you are actually performing an additional GET request in the background. Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 
Tom,

Thanks, but can you show me an example? Not quite sure if I am getting the point.

Thanks,

Anthony
 
Well, the scripting is rather complicated, so I can't give you an example of the whole thing, but the basic concept is very simple. When you click on a link, target it to your invisible frame (zero width and height), then onload() grab the content from that frame and set the source of your layer to the content. Hoila, the layer is updated indpendently of the rest of the layout. If you have questions about the javascript to achieve certain parts of that process, I suggest you read tutorials or ask questions on the javascript forum. Sincerely,

Tom Anderson
Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top