Results 1 to 10 of 10

Thread: New Yahoo Home Page Drop-in box

  1. #1
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New Yahoo Home Page Drop-in box

    Hi All,
    Does anyone know where could find the script that does a simular effect to new yahoo home page drop-in banner. It's cool - when banner drops, the whole page goes down.

    Thanks

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Code:
    <html>
    <head>
    <script language="javascript">
    var i=-100
    function slide() {
    i=i+2
    banner.style.marginTop=i
    if (i>0) {i=0}
    setTimeout("slide()",0)
    }
    onload=slide
    </script>
    <style type="text/css">
    body {
    margin:0
    }
    #banner {
    width:400px;
    height:100px;
    border:1px solid black;
    padding:4px;
    margin-top:-100px
    }
    </style>
    </head>
    <body>
    <div id="banner">BANNER</div>
    Page Content
    <br>Blah... test 123
    <br>More page content
    </body>
    </html>
    - Mike

  3. #3
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome job, mburt.

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Oh, it gets better..

    Code:
    <html>
    <head>
    <script language="javascript">
    var i=-100
    function slide() {
    i=i+2
    banner.style.marginTop=i
    if (i>0) {i=0}
    t1=setTimeout("slide()",0)
    }
    function slideOut() {
    clearTimeout(t1)
    i=i-2
    banner.style.marginTop=i
    if (i<-100) {i=-100}
    t2=setTimeout("slideOut()",0)
    }
    onload=slide
    </script>
    <style type="text/css">
    body {
    margin:0
    }
    #banner {
    width:400px;
    height:100px;
    border:1px solid black;
    padding:4px;
    margin-top:-100px
    }
    #close {
    position:absolute;
    width:100%;
    text-align:right;
    left:0px
    }
    </style>
    </head>
    <body>
    <div id="banner">BANNER
    <a href="#" id="close" onclick="slideOut()">[X]</a>
    </div>
    Page Content
    <br>Blah... test 123
    <br>More page content
    </body>
    </html>
    It has an [x] button at the top right hand corner of the banner, but it doesn't position right in Mozilla
    - Mike

  5. #5
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here even better, now it doesn't give me warnings:

    Code:
    <html>
    <head>
    <script language="javascript">
    var i =- 100;
    function slide() {
    i = i + 2;
    var element = document.getElementById("banner");
    element.style.marginTop=i
    if(i > 0) {
    i = 0;
    }
    t1 = setTimeout("slide()",0);
    }
    function slideOut() {
    clearTimeout(t1);
    i = i - 2;
    var element = document.getElementById("banner");
    element.style.marginTop = i;
    if(i <- 100) {
    i =- 100;
    }
    t2 = setTimeout("slideOut()",0);
    }
    onload=slide
    </script>
    <style type="text/css">
    body {
    margin:0
    }
    #banner {
    width:400px;
    height:100px;
    border:1px solid black;
    padding:4px;
    margin-top:-100px
    }
    #close {
    position:absolute;
    width:100%;
    text-align:right;
    left:0px
    }
    </style>
    </head>
    <body>
    <div id="banner">BANNER
    <a href="#" id="close" onclick="slideOut()">[X]</a>
    </div>
    Page Content
    <br>Blah... test 123
    <br>More page content
    </body>
    </html>

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Warnings suck
    - Mike

  7. #7
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Maybe this won't be so intrusive (with the margins)

    Code:
    <style type="text/css">
    body {
    margin-top:0px
    }
    #banner {
    width:400px;
    height:100px;
    border:1px solid black;
    padding:4px;
    margin-top:-100px
    }
    #close {
    position:absolute;
    width:100%;
    text-align:right;
    left:0px
    }
    </style>
    - Mike

  8. #8
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Great!!!!!

  9. #9
    Join Date
    Aug 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Any change to set a session so when you close the banner and refresh the page it wouldn't load untill new browser window is open?

  10. #10
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You need to place some additional functions. Use cookies if needed.

Bookmarks

Posting Permissions

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