locked
sorry........ here is the code.... RRS feed

  • Question

  •  

    This code allows u to scroll  title  text on a html page

     

    <!-- Scroll a message across the title bar forwards, -->
    <!-- backwards and with a delay. -->

     

    <script language="javaScript">
    var pos=0;
    var str="sandy ";
    // npos is used for forward scrolling
    var npos=str.length;
    // Normal upDate(). Other options upDateFW() and upDateWD()
    setInterval("upDate()",300);

    // Normal Scroll
    function upDate()
    {
      // Reset the title starting at pos
      document.title=str.substring(pos,str.length)+str.substring(0,pos);
      if(pos < str.length) pos++;
      else pos = 0;
    }

    // Scroll forward
    function upDateFW()
    {
      // Reset the title starting at pos
      document.title=str.substring(npos,str.length)+str.substring(0,npos);
      if(npos > 0) npos--;
      else npos = str.length;
    }

    // Scroll With Delay
    var delay = 20;
    function upDateWD()
    {
      if(pos < str.length) {
        document.title=str.substring(pos,str.length)+str.substring(0,pos);
      }  else {
        if(pos > str.length+delay) {
          pos = 0;
        }
      }
      pos++;
    }
    </script>

     

    Tuesday, March 13, 2007 11:09 AM

All replies

  • the code s fine.. but where shal i use it?
    Tuesday, March 13, 2007 1:40 PM
  • hw can i use it yar

    for here?

    Tuesday, March 13, 2007 1:42 PM
  • to use this code, copy it and place it between head tag. it should look like :

    <HTML>

    <HEAD>

    <!--Copy code given above here and replace this whole line -->

    </HEAD>

    <BODY>

    <!--Your page body goes here -->

    </BODY>

    </HTML>

    Tuesday, March 13, 2007 7:33 PM
  • This is a nice one.. ill give a simple use of it.. This code allows you to scroll ur title ...
    Its useful in giving a big title in the head.. like explaining the page.. Now big title often get scrolled out of the page and we are not able to view it properly.. this code will allow us to make them scroll so that the viewer can read the whole title...
    Nice one bro.. thankz for the code...
    Tuesday, March 13, 2007 7:39 PM
  • good code
    Wednesday, March 14, 2007 6:29 AM