This is continued from a discussion of FreewayTalk, but the basic problem being explored is hiding content on the page that you wish to later display after the page loads using a timer or other effect.
In my limited testing, there’s no way to use document.write
inside of a CSS block to extend a style for JS-enabled browsers. About as close as I can get is the following:
<style type="text/css" media="screen">
#something{
height:200px;
border:1px solid #ccc;
background-color:#eeeeff;
}
</style>
<script type="text/javascript" charset="utf-8">
function hideIt(itemId){
if (document.getElementById(itemId)){
return document.getElementById(itemId).style.display = 'none';
}
return;
}
</script>
</head>
If you are using Prototype, then it’s much easier than that. My example does not allow you to do a whole collection of elements without writing a separate hideIt()
call for each one, for example, while Prototype lets you do the following quite neatly and expressively:
$('thing1','thing2','thing3').invoke('hide');
It’s worth while to explore what you can do using Prototype. It’s a very complete developer toolkit that can extend your pages in very surprising and elegant ways.
Walter
dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options