Results 1 to 3 of 3

Thread: Crossfade slideshow

  1. #1
    Join Date
    Mar 2010
    Posts
    16
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Question Crossfade slideshow

    HI,

    I have implemented a jquery slideshow. Every thing is fine with its working.
    But i want random image to appear every time the page is viewed. Is there any possibility for that?

    The slideshow about which i am speaking can be found in the below link.
    http://www.jirehdesigners.com/HIDDEN/


    The script inside of the page:
    <script type="text/javascript" src="js/jquery.cross-slide.js" language="javascript"></script>

    <script type="text/javascript">
    jQuery(function() {
    jQuery('#ccc').crossSlide({
    sleep: 5,
    fade: 3
    }, [
    { src: 'pictures/Croatia-2.jpg' },
    { src: 'pictures/Galapagos.jpg' },
    { src: 'pictures/Vietnam-Beach.jpg' },
    { src: 'pictures/Antarctica.jpg' },
    { src: 'pictures/Canada.jpg' },
    { src: 'pictures/Elephant Expeditions main page.jpg' },
    { src: 'pictures/Indochina main page.jpg' },
    { src: 'pictures/Laos main page.jpg' }
    ]);
    });
    </script>

    This is the div:

    <div id="ccc" class="contentdiv">Loading....</div>
    Please help me.
    Thank you very much in advance.
    Last edited by naveen.brite; 04-13-2010 at 04:22 PM.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
      jQuery(function() {
        var ary=['pictures/Croatia-2.jpg','pictures/Galapagos.jpg','pictures/Vietnam-Beach.jpg','pictures/Antarctica.jpg','pictures/Canada.jpg','pictures/Elephant Expeditions main page.jpg','pictures/Indochina main page.jpg','pictures/Laos main page.jpg'];
        ary.shuffle();
        jQuery('#ccc').crossSlide({
          sleep: 5,
          fade: 3
        }, [
          { src: ary[0] },
          { src: ary[1] },
          { src: ary[2] },
          { src: ary[3] },
          { src: ary[4] },
          { src: ary[5] },
          { src: ary[6] },
          { src: ary[7] }
        ]);
      });
    
    Array.prototype.shuffle=function(){
     for (var r,t,z0=0;z0<this.length;z0++){
      r=Math.floor(Math.random()*this.length);
      t=this[z0];
      this[z0]=this[r];
      this[r]=t;
     }
    }
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. The Following User Says Thank You to vwphillips For This Useful Post:

    naveen.brite (04-13-2010)

  4. #3
    Join Date
    Mar 2010
    Posts
    16
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Smile Thanks

    Thanks a lot....
    The code that you have written is the perfect solution.
    Really helpful.
    Thank you very much....

Bookmarks

Posting Permissions

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