PDA

View Full Version : CSS target loading



weegillis
11-15-2003, 11:22 PM
How could a person utilize CSS to have a page behave similar to frames (allowing target content to fill the same area of the screen without refreshing the entire page)?

redcircle
11-15-2003, 11:57 PM
put your content on different div's then when a link is clicked you would use javascript to hide one and show the other.



function Vis()
{
document.getElementById('content').style.visibilit y ='visible';
document.getElementById('content-container').style.zIndex =10;
document.getElementById('content').style.display ='block';
}
function noVis()
{
document.getElementById('content').style.visibilit y ='hidden';
document.getElementById('content-container').style.zIndex =3;
document.getElementById('content').style.display ='none';



}


The down side to the increased load time. All the content for all the pages must be loaded for this to work.

Is it really that necessary NOT to have it refesh?

paulhiles
11-16-2003, 06:24 AM
How could a person utilize CSS to have a page behave similar to frames (allowing target content to fill the same area of the screen without refreshing the entire page)?
Hi weegillis,

I'd go along with redcircle's reply... the best way of achieving the effect of frames is by using JavaScript to manipulate the visibility of predetermined div layers.

However, if you want to use CSS only.. Eric Meyer has an interesting CSS popup demo (http://www.meyerweb.com/eric/css/edge/popups/demo.html) which demonstrates placing different text elements into one targetted 'content' div layer.

Paul

weegillis
11-16-2003, 04:08 PM
Thanks Paul and redcircle. Eric Meyer is surely one person to sit up and listen to when it comes to CSS. I'm also sure he is not alone, but his presentations are much easier to follow than some others I've examined.

What's more, he would appear to have given a lot of thought to his creations... they all degrade extremely gracefully without CSS support, which is something I would love my own pages to do. I actually learned something today!

Thanks, all.

Roy