Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Seen the new javascript ad open on yahoo? heres how

    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>

  • #2
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thats kinda cool but i can't find a demo of the script in use on yahoo or anywhere else.

  • #3
    New to the CF scene
    Join Date
    Sep 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •