Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6673121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:35:25+00:00 2026-05-26T03:35:25+00:00

Weird problem this. I’ve got a web page that fades images in and out

  • 0

Weird problem this. I’ve got a web page that fades images in and out on a timer, using jQuery’s fadeIn() and fadeOut() methods. It worked fine in Firefox and Chrome, but not in IE9 – only the first image ever showed. After a lot of removing CSS, HTML, etc, to whittle down the reason, I managed to get it working in IE9 but only if I remove the first line of my HTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

With that line present, fadeIn() fails. Without that line, fadeIn() works. fadeOut() appears to work regardless.

I’m using the latest stable build of jQuery (downloaded yesterday).

This is the HTML file:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script src="scripts/jquery.js" type="text/javascript"></script>
        <script src="scripts/imageswitch.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="myGallery">
            <img src="/images/Img1.jpg" id="firstimg" class="active ready" onload="setInterval( 'swapImages()', 3000 );" />
            <img src="/images/Img2.jpg" onload="SetImgReady(this);" />
            <img src="/images/Img3.jpg" onload="SetImgReady(this);" />
        </div>
    </body>
</html>

This is the contents of “imageswitch.js”: (I use the SetImgReady() function to add the ‘ready’ class to each image once it’s finished downloading, so it only ever rotates between fully loaded images)

function swapImages() {
    var $active = $('#myGallery .active');
    var $next = ($('#myGallery .active').next().length > 0) ? $('#myGallery .active').next() : $('#myGallery img:first');

    while ($next && !$next.hasClass('ready')) {
        if ($next.next().length > 0)
            $next = $next.next();
        else
            $next = false;
    }

    if ($next && $active) {
        $next.fadeIn( 2000 ).addClass('active');
        $active.fadeOut( 2000 ).removeClass('active');
    }
}

function SetImgReady( $ImgObj ) {
    if ($ImgObj)
        $ImgObj.className += "ready";
}

And this is the CSS:

#myGallery{
    position:relative;
    width:400px;
    height:300px;
}
#myGallery img{
    display:none;
    position:absolute;
    top:0;
    left:0;
    border: 1px solid black;
}
#myGallery img.active{
    display:block;
}

So… is the declaration making IE9 go overly-standards-compliant and decide that fading isn’t allowed under XHTML1.0 or something?

Another odd thing that also happens, once the fading is working: On only the first image switch, the displayed image dissapears immediately instead of fading out. All other images nicely fade in/out as required. Any thoughts on that too?

Thanks all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:35:26+00:00Added an answer on May 26, 2026 at 3:35 am

    I had the same issue with 1.6.2. An update to 1.6.4 solved it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this weird problem with FileMaker Pro 12. I am using it for
Weird problem this, I'm using a CSS3 gradient to create a faded out overlay
This is a very weird problem. My app that runs just fine but somehow
This is a weird problem. I am using a dataform, and when I edit
this is a long question and weird problem that I hope to solve. My
I've got a weird problem where if i do something like this in a
I am having a very weird problem that I've never had before when using
I got a weird problem with certificate request that I submit successfully, but when
I got this weird problem where System.Action cant be resolved when its not explicitly
I've got this weird problem - I'm calling ChangeServiceConfig on a newly installed service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.