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

  • Home
  • SEARCH
  • 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 6347533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:14:03+00:00 2026-05-24T21:14:03+00:00

I ran into a problem when making a carousel with jQuery. It works just

  • 0

I ran into a problem when making a carousel with jQuery. It works just fine with Chrome, FF, IE7 and IE9. IE8 is the only one with problems.

The carousel has items floating side by side, and when an item is clicked, its width is extended to show the content. And if clicked again, it retracts back to its original width.

The problem is that when I click one of the items (item1) it doesn’t work. And when I take a look at it with IE’s dev tools, I can clearly see that it is in fact open. It just doesn’t render the change. Then if I click the element right of the item1 (item2), item1 jumps to the extented width without animating. If I click item1 again, it retracts back to original width and this is where the problem occurs. Item2 is still far to the right when it should be right next to item1.

I replicated this problem with a much simpler example than my original project, since it’s quite big.
Full html/css/js source pasted lower.

How to replicate (test with other browsers first to see how it is supposed to work):

  1. scroll the pane to the right so that you can see the third (yellow) and the fourth (gray) element
  2. click the yellow element
  3. click the gray element
  4. click the yellow element again

Now you should see black (the color of the items’ parent element) on the right side of the yellow element. And if you scroll to the right, you can see the gray element there.

And my question is, has anyone had this problem before and is there a solution for it?

Source:

<!DOCTYPE html> 
<html> 
<head><title>ie testing</title> 
 
<style type="text/css"> 
    
    #test {height: 150px; background-color: black; overflow:auto;position:relative;width:700px;border: 1px solid black;}
    #pane {width: 5000px;position:relative;}
    .item {width: 240px; height: 150px; float:left; overflow: hidden; position:relative;}
    #item1 {background-color: red;}
    #item2 {background-color: blue;}
    #item3 {background-color: yellow;}
    #item4 {background-color: gray;}
    #item5 {background-color: pink;}
    #item6 {background-color: white;}
    .item-content { height: 150px; width: 2px;} /* this didn't seem to affect anything */
 
</style> 
 
</head> 
<body> 
 
  <div id="test"> 
    <div id="pane"> 
        <div id="item1" class="item"><div class="item-content"> </div></div> 
        <div id="item2" class="item"><div class="item-content"> </div></div> 
        <div id="item3" class="item"><div class="item-content"> </div></div> 
        <div id="item4" class="item"><div class="item-content"> </div></div> 
        <div id="item5" class="item"><div class="item-content"> </div></div> 
        <div id="item6" class="item"><div class="item-content"> </div></div> 
        <div style="clear:both; float:none;"> </div> 
    </div> 
  </div> 
 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 
<script type="text/javascript"> 
    t = $("#test");
    $pane = $("#pane");
    $items = $(".item", $pane);
    startw = $($items[0]).width();
 
    $(".item", $pane).click(function() {
        $t = $(this);
        if ($t.width() == startw) {
            $t.animate({width:700}, 200);
        } else {
            $t.animate({width:startw}, 200);
        }
    });
 
    asd1 = $("#item1");
    asd2 = $("#item2");
    asd3 = $("#item3");
    asd4 = $("#item4");
    asd5 = $("#item5");
    asd6 = $("#item6");
    
</script> 
</body> 
</html> 
  • 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-24T21:14:05+00:00Added an answer on May 24, 2026 at 9:14 pm

    Some kind of solution found by deadeye536 at facepunch.com.

    Looks like IE8 is failing to redraw.

    This is a very ugly solution, but it’s the only one I could come up with.

    $(".item", $pane).click(function() {
        $t = $(this);
        if ($t.width() == startw) {
            $t.animate({width:700}, 200);
        } else {
            $t.animate({width:startw}, 200);
        }
    window.setTimeout(function() {
        if ($.browser.msie&&$.browser.version.slice(0,1)=="8") {
            $('.item').each(function() {
                this.style.cssText = this.style.cssText;
            });
        }
    }, 205);
    });
    

    So it basically resets the items’ CSS. It still doesn’t look perfect, but I can live with that. At least it works now.

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

Sidebar

Related Questions

I am making a Virtual Machine and I just ran into a BIG problem.
Never ran into this problem with jQuery before. I have the following: $(document).ready(function() {
I just ran into a problem with the version of JAX-WS in JDK 1.6.0
I'm just starting WPF so am just learning but I've ran into a problem
While making my code, i ran into a strange problem. I hold 1 file
I am making an android 2d game and ran into a problem. I made
I'm making a game with Python->PyGame->Albow and ran into a problem with board generation.
I'm making a timeline view in html but I ran into the following problem:
I'm making a web site and suddenly I ran into a problem. It's not
I ran into the problem that my primary key sequence is not in sync

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.