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 274

    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

     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);
     }
    }

     


     

    View Blog For Latest Updates
    My Blog http://www.center4code.blogspot.com/

    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 9,418
    • 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)
Microsoft Communities
Page view counter