Results 1 to 2 of 2

Thread: Using more than one swap image rotation behaviour

  1. #1
    Registered
    Join Date
    Jun 2008
    Location
    Canada
    Posts
    1
    Rep Power
    0

    Question Using more than one swap image rotation behaviour

    Hi All,

    I was hoping that someone could help me. I have a page that I want to swap images in rotation. Now the thing is that I have 6 images in a table and each of those 6 images will have that behaviour on them. So I have found that only one of my images will do the swapping up, probably because the javascript is not working correctly with each other. I will paste the code here and perhaps someone can give me some direction on this. Thanks!!

    Code:
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image1.gif','images/logos/image2.gif','images/logos/image3.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 3000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image11.gif','images/logos/image12.gif','images/logos/image13.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 30000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator2', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image21.gif','images/logos/image22.gif','images/logos/image23.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 3000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator3', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image31.gif','images/logos/image32.gif','images/logos/image33.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 3000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator4', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image41.gif','images/logos/image42.gif','images/logos/image43.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 3000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator5', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    
    // Comma separated list of images to rotate 
    var imgs = new Array('images/logos/image51.gif','images/logos/image52.gif','images/logos/image53.gif');
    // delay in milliseconds between image swaps 1000 = 1 second 
    var delay = 3000;
    var counter = 0;
    
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
      }
    }
    
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      }
      MM_swapImage('rotator6', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    }
    
    
    
    //-->
    Last edited by Doc C; 6-4-08 at 11:39 PM. Reason: added code tags

  2. #2
    Registered
    Join Date
    Jul 2008
    Location
    Puerto Rico
    Posts
    19
    Rep Power
    0
    It apears that you are trying to build some king of slide-show.... i would start all over again, the code its not consistant at all, not sure what it is. You can simplifly your life by using flash for this kind of effects, just add them to your table and thats it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •