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 8046531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:48:54+00:00 2026-06-05T05:48:54+00:00

http://jsfiddle.net/x6PCD/11/ I’m trying to make a slideshow that fades between several absolute-positioned div’s. On

  • 0

http://jsfiddle.net/x6PCD/11/

I’m trying to make a slideshow that fades between several absolute-positioned div’s. On Chrome, IE9, Opera the code below works fine. But on Firefox, the timeout goes once or twice, then stops. If you remove the JS section marked below, it loops properly.

<style>
.slide {position:absolute; top:0; left:0; width:300px; height:200px}
</style>
<div id="slides" class="slides">
<div class="slide slide1" style="background:#c66">
  <div class="swap_links">
    <a href="javascript:" class="active">1</a>
    <a href="javascript:">2</a>
    <a href="javascript:">3</a>
  </div>
</div>
<div class="slide slide2" style="background:#6c6">
  <div class="swap_links">
    <a href="javascript:">1</a>
    <a href="javascript:" class="active">2</a>
    <a href="javascript:">3</a>
  </div>
</div>
<div class="slide slide3" style="background:#36c">
  <div class="swap_links">
    <a href="javascript:">1</a>
    <a href="javascript:">2</a>
    <a href="javascript:" class="active">3</a>
  </div>
</div>
</div>
<script type="text/javascript">
$(function() {

    var fp = '#slides .slide';
    var fs = 300;

    var t = window.setTimeout(swap, 1000);

    $(fp).slice(1).hide();

    function swap(to) {

        //removing this section, loop plays in FF
        if (to) {
            $(fp + to).fadeIn(fs);
            $(fp).not('.slide' + to).fadeOut(fs);
            window.clearTimeout(t);
            return;
        }

        $(fp).eq(1).fadeIn(fs);
        $(fp).eq(0).fadeOut(fs, function() {
            $(this).appendTo('#slides');
            t = window.setTimeout(swap, 1000);
        });

    }

    $('#slides .swap_links a').click(function() {
        swap($(this).html());
    });

});
</script>
  • 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-06-05T05:48:56+00:00Added an answer on June 5, 2026 at 5:48 am

    FireFox appears to have been passing arbitrary numeric values to the to variable within your function causing the if(to){...} statement to execute if the passed value was anything but 0.

    To fix this execute the swap() function without arguments in the setTimeout() like this:

    var t = window.setTimeout(function(){ swap(); }, 1000);
    

    Here is the updated demo: http://jsfiddle.net/x6PCD/14/

    I hope this helps!

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

Sidebar

Related Questions

http://jsfiddle.net/JamesKyle/re73T/ Trying to make a class switcher that will do the following: On Load
http://jsfiddle.net/hL6rT/1/ I've created div with a absolute positioned image inside it the idea is
http://jsfiddle.net/AndyMP/nUhhf/1/ This is a simplified situation where I have a DIV that animates downwards
http://jsfiddle.net/ZtpEU/41/ heres a simple animation in jquery. I'm trying to make it so the
http://jsfiddle.net/zjRga/55/ I want a div to open up that will appear over top of
http://jsfiddle.net/n8YsM/ How do I make the div id blue take up the remaining visible
http://jsfiddle.net/FYtJH/1 The filtering select needs to warn users that they're about to change the
http://jsfiddle.net/9BCrs/5/ I have this set up to load a file into a DIV using
http://jsfiddle.net/fJkBU/1/ That's my code. Basically, I have an iFrame whose source may change. I
http://jsfiddle.net/fQv97/ HTML <div class=table-cell> My text, should be align middle </div> CSS .table-cell {

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.