...

Seen the new javascript ad open on yahoo? heres how

neo_ludite
09-27-2002, 06:59 AM
This is a more compact view of the "open ad" code on yahoo.
<pre>
<script language=javascript>
// these are the two links for opening and closing the ad
var lnk1='<a href="#" onclick="moveIt(\'1\');return false">Open&nbsp;Ad</a>';
var lnk2='<a href="#" onclick="moveIt(\'0\');return false">Close&nbsp;Ad</a>';

// these are the contents of the table, you can put anything in here
var ad1='CLOSED STATE';
var ad2='OPEN STATE';

// this function actually moves the DIV size
function moveIt(status)
{
var tout=0;
if(status == '1')
{
lnkdiv.innerHTML=lnk2;
adstate.innerHTML=ad2;
if (document.all.addiv.style.pixelHeight<250)
{
document.all.addiv.style.pixelHeight=document.all.addiv.style.pixelHeight+5;
tout=setTimeout('moveIt('+status+')',1);
}

}
else
{
lnkdiv.innerHTML=lnk1;
adstate.innerHTML=ad1;
if (document.all.addiv.style.pixelHeight>=105)
{
document.all.addiv.style.pixelHeight=document.all.addiv.style.pixelHeight-5;
tout=setTimeout('moveIt('+status+')',1);
}
}

}
</script>

<table border="1"><tr><td><div id=addiv

style="position:relative;height:100;width:300;z-index:3"><div id=adstate>CLOSED

STATE</div></div></td></tr></table>
<div id=lnkdiv><a href="#" onclick="moveIt('1');return false">Open&nbsp;Ad</a></div>
</pre>

KevinG
10-01-2002, 04:44 PM
thats kinda cool but i can't find a demo of the script in use on yahoo or anywhere else.

neo_ludite
10-01-2002, 10:04 PM
Thanks, Yahoo pulled the ad after only two days, it originally had a graphic for the new porche in the closed state, and then played a movie of the porche in the open state.

The open state also pushed the right hand column with the news etc down, it looked kinda cool :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum