How to Make a Title Bar Scroll

The title bar is located at the very top of your Web page and contains the name of the page. Sometimes your Web page's title might be too long to fit within the title bar, making it so users cannot see the entire title of the website and current page they are on. Luckily, you can make a title bar scroll across the top of the browser window so that your entire title is visible.

Instructions

    • 1

      Open the Web page file for which you want to make the title bar scroll.

    • 2

      Copy and paste the following JavaScript code between the head tags (<head> and </head>) of the Web page's HTML code:

      <script type="text/javascript">

      var repeat=1

      var title=document.title

      var leng=title.length

      var start=1

      function titlemove() {

      titl=title.substring(start, leng) + title.substring(0, start)

      document.title=titl

      start++

      if (start==leng+1) {

      start=0

      if (repeat==0)

      return

      }

      setTimeout("titlemove()",150) // Adjust this number to adjust the speed of the scroller (Higher is slower, Lower is Faster)

      }

      if (document.title)

      titlemove()

      </script>

      Change the "var title" to the title of your Web page (e.g. var title=Website Title)

    • 3

      Save the changes to your Web page.

Tips & Warnings

  • Change the "var repeat" to "0" to make the title only scroll once (e.g. var repeat=0).

  • Change the "setTimeout" number to adjust the speed of the scroll (e.g. setTimeout("titlemove0" , 50). Increase the number to increase the speed and decrease it to decrease the speed.

  • Beware of altering the wrong parts of the code because it won't work if you do.

Related Searches:

References

Comments

Related Ads

Featured