Results 1 to 2 of 2

Thread: moving message follows crusor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2005
    Posts
    7

    Default moving message follows crusor

    this script will cause your message to scroll to the left, and it will follow your cursor

    *put it between <body> ... </body>
    *double click will cause your message to disappear
    Code:
    <SCRIPT language="JavaScript1.2"> 
    <!--
    
    var scroller_msg='YOUR MESSAGE GOES HERE'
    
    //dismissafter=0 means after how many seconds will your massege disappear, 0 means never.
    var dismissafter=0
    
    var initialvisible=0
    if (document.all)
    document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:1px solid black;font-size:14px;background-color:white;visibility:hidden">'+scroller_msg+'</marquee>')
    
    function followcursor(){
    
    if (initialvisible==0){
    curscroll.style.visibility="visible"
    initialvisible=1
    }
    
    curscroll.style.left=document.body.scrollLeft+event.clientX+10
    curscroll.style.top=document.body.scrollTop+event.clientY+10
    }
    
    function dismissmessage(){
    curscroll.style.visibility="hidden"
    }
    
    if (document.all){
    document.onmousemove=followcursor
    document.ondblclick=dismissmessage
    if (dismissafter!=0)
    setTimeout("dismissmessage()",dismissafter*1000)
    }
    
    //-->
     </SCRIPT>
    enjoy

  2. #2
    Join Date
    Aug 2005
    Posts
    1

    Default

    yes but if u move the cursor to the left of the page, the page will resize (at least I think so). That's nasty!

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
  •