Page view counter

Javascript setInterval

Last post 07-09-2008 11:34 AM by NC01. 3 replies.

Sort Posts:

  • Javascript setInterval

    07-08-2008, 5:38 PM

    Hi:

           Can any one suggest me how to implement the Code 1 logic into Code 2.I have mentioned the code1, code2 below.

     

    Code1:

     function init()
    {
     for (var i=0; i<8; i++)
     {
      document.getElementById('btn' + i).displayValue = i;
      document.getElementById('btn' + i).onclick = function(){display(this.displayValue);};
     }
    }

     

     

    Code2:

    var i;moveTimer = new Array(8); for(i=0;i<8;i++)
    {

    moveTimer[i] = window.setInterval(function() {moveSlideLeft('img' + i);},50);
    }

     

    Thanks:

    Suresh

     

    Filed under:
  • Re: Javascript setInterval

    07-09-2008, 1:16 AM
    • Loading...
    • Maulik Patel
    • Joined on 12-21-2007, 6:48 AM
    • Ahmedabad
    • Posts 324
    • Points 2,294

    What actually you want to do ? you want to merge code1's logic to code2 ? OR Refine your problem so people can answer better. 

    Maulik Patel
    MCTS, Software Engineer

    Don't forget to click "Mark as Answer" on the post that helped you. This will give you point and help readers to know which post solved your issue and make their search easy.
  • Re: Javascript setInterval

    07-09-2008, 2:49 AM
    Answer
    • Loading...
    • sameer_khanjit
    • Joined on 12-10-2007, 1:06 PM
    • Indore India
    • Posts 636
    • Points 3,089

     function init()
    {

    var moveTimer = new Array(8);
     for (var i=0; i<8; i++)
     {
      document.getElementById('btn' + i).displayValue = i;
      document.getElementById('btn' + i).onclick = function(){display(this.displayValue);};

    moveTimer[i] = window.setInterval(function() {moveSlideLeft('img' + i);},50);
     }
    }

     


     

    We Are Looking for .NET/PHP Projects

    Contact Details :-

     Email - sameer.khanjit@gmail.com

     Mobile no. : +91-9893795983

     View Blog

    linkedin Asp.net Group

    Don't forget to click “Mark as Answer” on the post that helped you
  • Re: Javascript setInterval

    07-09-2008, 11:34 AM
    Answer
    • Loading...
    • NC01
    • Joined on 08-26-2005, 3:33 PM
    • Posts 13,275
    • Points 71,391
    • TrustedFriends-MVPs

    All ready answered here: http://forums.asp.net/t/1286883.aspx

    Please don't make duplicate posts.

    NC...

     

Page 1 of 1 (4 items)