Results 1 to 1 of 1

Thread: Auto scrolling window

  1. #1
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Auto scrolling window

    Copy the below and paste under body IF YOU WANT MUSIC! Futher down is the scrolling window


    <SCRIPT language="JavaScript">
    if (navigator.appName == "Netscape" && navigator.appVersion.indexOf("Win") > 0)
    {
    document.writeln("<embed type=application/x-mplayer2 pluginspage=http://www.microsoft.com/Windows/MediaPlayer/ Name=MediaPlayer src=midi/journey.mid AutoStart=True ShowStatusBar=0 HEIGHT=1 WIDTH=1></embed>");
    }
    else if (navigator.appVersion.indexOf("Win") > 0)
    document.writeln("<BGSOUND SRC=midi/journey.mid LOOP=INFINITE VOLUME=-500>");
    else
    document.write( '<embed src = "midi/journey.mid" autostart="true" hidden="true" loop="true" ></embed>' );
    </SCRIPT>

    Here copy the below for the self scrolling window. I activates when the user hit the down arrow button. Also place under body.

    <SCRIPT language=JavaScript1.2>
    if(navigator.appName.indexOf("WebTV") != -1)
    var x=1
    else
    {
    var x=1
    var cp=0,alt=1,curpos1=0,curpos2=-1
    function initialize(){
    startit()
    }
    function sw(){
    if (document.all)
    temp=document.body.scrollTop
    else
    temp=window.pageYOffset
    if (alt==0)
    alt=2
    else
    alt=1
    if (alt==0)
    curpos1=temp
    else
    curpos2=temp
    if (curpos1!=curpos2){
    if (document.all)
    cp=document.body.scrollTop+x
    else
    cp=window.pageYOffset+x
    window.scroll(0,cp)
    }
    else{
    cp=0
    window.scroll(0,cp)
    }
    }
    function startit(){
    setInterval("sw()",50)
    }
    window.onload=initialize
    }
    </SCRIPT>

    To preview it Check Out http://llerrah.com/mygarden.htm Let me know if it don't work.
    Last edited by Hinsh; 03-06-2007 at 01:40 PM. Reason: Wanted to get replies about the javascript

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
  •