making slideshow images blend and rotate

Discussion in 'Javascript' started by Whitney, Jul 23, 2004.

  1. Whitney

    Whitney Guest

    I ran across a chunk of code that allows me to blend images in and out
    (works great!) but now I need to figure out a way to randomize the
    order that these images appear. I have a bunch of pics and I'd like
    to give them all a fair shot at getting seen =)

    Any help would be GREATLY appreciated!!

    Here's the code:


    <script language="JavaScript1.1">

    //specify interval between slide (in mili seconds)
    var slidespeed=3000

    //specify images
    var slideimages=new Array("image1.gif","image2.gif","image3.gif")

    //specify corresponding links
    var slidelinks=new Array("","","")

    var newwindow=1 //open links in new window? 1=yes, 0=no

    var imageholder=new Array()
    var ie=document.all
    for (i=0;i<slideimages.length;i++){
    imageholder=new Image()

    function gotoshow(){
    if (newwindow)[whichlink])




    <a href="javascript:gotoshow()"><img src="image1.gif" name="slide"
    border=0 style="filter:blendTrans(duration=3)" width=97

    <script language="JavaScript1.1">

    var whichlink=0
    var whichimage=0
    var blenddelay=(ie)? document.images.slide.filters[0].duration*1000 :
    function slideit(){
    if (!document.images) return
    if (ie) document.images.slide.filters[0].apply()
    if (ie) document.images.slide.filters[0].play()
    whichimage=(whichimage<slideimages.length-1)? whichimage+1 : 0

    Whitney, Jul 23, 2004
    1. Advertisements

  2. Whitney

    Lee Guest

    Whitney said:
    function shuffle(arr) {
    for (var i = arr.length - 1; i > 0; i--) {
    // Interchange element i with a random element not after it
    var j = Math.floor((i + 1) * Math.random());
    var t = arr;
    arr = arr[j];
    arr[j] = t;

    Lee, Jul 24, 2004
    1. Advertisements

  3. Whitney

    Whitney Cali Guest

    works perfectly! thanks a million!
    Whitney Cali, Jul 26, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.