New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact

<html>

<head>
<style type="text/css">

.revealcontent{
visibility: hidden;
}

</style>

<script type="text/javascript">

/***********************************************
* Sequential Content Revealer- Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

var contentpause=1000 //customize time each content should pause for before the next one is revealed (1000=1 second)
var once_session=0 //Should "reveal" animation only be applied once per browser session? (0=no, 1=yes):

var curobjindex=0
var orderoffset=100

function collectElementbyClass(){
var classname="revealcontent"
glidearray=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname){
glidearray[inc++]=alltags[i]
glidearray[inc-1].displayorder=(glidearray[inc-1].getAttribute("displayorder"))? parseInt(glidearray[inc-1].getAttribute("displayorder")) : inc+orderoffset
}
}
if (glidearray.length>0){
glidearray.sort(compareorder)
seqreveal()
}
}

function seqreveal(){
if (curobjindex<glidearray.length){
glidearray[curobjindex].style.visibility="visible"
var actualpause=(glidearray[curobjindex].getAttribute("pausesec"))? parseFloat(glidearray[curobjindex].getAttribute("pausesec"))*1000 : parseFloat(contentpause)
glidetimer=setTimeout("seqreveal()",actualpause)
curobjindex++
}
}

function compareorder(a, b){
return a.displayorder-b.displayorder
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

if (once_session && get_cookie("textdisplayed")=="" || !once_session){
if (window.addEventListener)
window.addEventListener("load", collectElementbyClass, false)
else if (window.attachEvent)
window.attachEvent("onload", collectElementbyClass)
else if (document.getElementById)
window.onload=collectElementbyClass

if (once_session)
document.cookie="textdisplayed=yes"
}
else
document.write('<style>\n.revealcontent{visibility:visible;}\n</style>')
</script>
</head>

<body>

<img class="revealcontent" src="ddmouse1.gif">
<img class="revealcontent" src="ddmouse2.gif">
<div class="revealcontent">Some text.</div>

</body>
</html>