Fade In/Out Works in IE and not in Firefox Version 3.03.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • g1r2a3
    New Member
    • Oct 2008
    • 1

    Fade In/Out Works in IE and not in Firefox Version 3.03.

    Hello:

    The following script

    [HTML]// =============== =============== =========
    // do not edit anything below this line
    // =============== =============== =========

    var t
    var j = 0
    var p = Pic.length

    var preLoad = new Array()
    for (i = 0; i < p; i++){
    preLoad[i] = new Image()
    preLoad[i].src = Pic[i]
    }

    function runSlideShow(){

    if (document.all){

    document.images .SlideShow.styl e.filter="blend Trans(duration= 3)"
    document.images .SlideShow.filt ers.blendTrans. Apply()
    }

    document.images .SlideShow.src = preLoad[j].src

    if (document.all){

    document.images .SlideShow.filt ers.blendTrans. Play()
    }

    j = j + 1
    if (j > (p-1)) j=0
    t = setTimeout('run SlideShow()', speed)
    }



    </script>[/HTML]


    Fades & switching to the next picture work fine in IE, but no Fades in Mozilla Firefox Version 3.03 just switching to next picture. Is there a way to get the fading to work also in Firefox ?

    Thank You for your help in Advance
    Last edited by gits; Oct 18 '08, 10:13 PM. Reason: added code tags
  • zaphod42
    New Member
    • Oct 2008
    • 55

    #2
    firefox doesn't use filters the same way ie does....you do all your fading using ie filters....mozi lla just uses the
    Code:
    myEl.style.opacity
    property, you need an else in your function after you do the fade for ie that changes the opacity for ff

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5388

      #3
      that's right, and just two more notes on the shown code (just improvements and no real problems ;) ):

      1. i strongly recommend to use a semicolon to terminate every statement correctly even when they (for the moment) are not strictly required

      2. the eval like usage in the setTimeout() method is quite ugly and not required:

      instead of using:

      [CODE=javascript]t = setTimeout('run SlideShow()', speed)[/CODE]
      just use the name of the function as the reference:

      [CODE=javascript]t = setTimeout(runS lideShow, speed);[/CODE]
      kind regards

      Comment

      Working...