JavaScript + jquery Implementation timed change article title

Source: Internet
Author: User
Tags time interval
Use a timer written by Javascript+jquery to change the title of the article regularly.       Code as follows: <! DOCTYPE html>  <html>  <head>  <title>todo supply a title</title>  < Meta charset= "GB2312" >  <meta name= "viewport" content= "Width=device-width" >  </head>    <body>  <div>  <ul id= "Joketitle" >  <li class= "line" >test line one</ li>  <li class= ' line ' >test line two</li>  <li class= ' line ' >test line three</li>& nbsp </ul>  </div>  <script type= "Text/javascript" src= "Ie/js/jquery-1.9.0.min.js" ></ script>  <script type= "Text/javascript" >  $ (document). Ready (function () {    var Changejoketitle = {  Line:3,//Joke's total number   timespan:1850,//time interval (milliseconds)   interval: ',//timer handle to stop   showlineflag:0,//Logo,  change:function () {    var currentline = (++changejoketitle.showlineflag)% ( ChangejoketitlE.line);    $ (' #jokeTitle li:eq (' +currentline+ ') '). Show ();  $ (' #jokeTitle li:not (: eq (' +currentline+ ') ). Hide (); },  run:function () {  $ (' #jokeTitle li:eq (0) '). Show ();  $ (' #jokeTitle li:not (: eq (0) ). Hide ();  changejoketitle.interval = SetInterval (Changejoketitle.change, Changejoketitle.timespan); }  };    Changejoketitle.run ();   });  </script>  </body>    & lt;/html>   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.