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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:56:01+00:00 2026-06-14T07:56:01+00:00

I’m trying to put two carousels in a page, each in a different panel

  • 0

I’m trying to put two carousels in a page, each in a different panel of a tabbed navigation, but it’s not working. I’ve trying troubleshooting the jCarousel script but I guess the problem occurs when the tabs and the jCarousel scripts interact.

Anyway, my HTML is more or less like this:

<div id="myTabs">
  <ul><!-- Tabs navigation -->
    <li><a href="#foo">Foo</a></li>
    <li><a href="#bar">Bar</a></li>
  </ul>
  <div id="foo">
    <ul>
      <li><!-- Quite complex content inside each LI, but set width of 255px --></li>
      <!-- Dynamic number of LI. Minimum of 4 items -->
      .
      .
      .
    </ul>
  </div>
  <div id="bar">
    <!-- Another UL, just like #FOO -->
  </div>
</div>

So, I need to apply the tabs on #myTabs and this is the code: $('#myTabs').tabs(). I also need to apply jCarousel to the ULs inside #foo and #bar and this is the call I’m using:

$('#myTabs > div > ul').jcarousel({
    scroll: 1,
    animation: 'slow',
    wrap: 'circular'
});

The carousel in the first panel is being correctly created. Everything goes smooth there. The problem happens when I click one tab to display the hidden panel: the carousel navigation doesn’t work and the console throws an error "jCarousel: No width/height set for items. This will cause an infinite loop. Aborting... "

However, when I try to set the property itemFallbackDimension to 255px, what happens is that the UL of the hidden panel recieves a width of 510px. That’s exactly the width of two LI elements, but there are at least 4 in the UL. Therefore, although now the navigation works, the layout is completely broken. (see image)

These problems only happen in the hidden panel of the tabs. I think that’s because jCarousel internally relies on the innerWidth() method to calculate the UL‘s width but that returns 0 when the container is set to display: none –and that’s exactly what tabs does to hide the panel.

How can I fix it?

  • 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-14T07:56:03+00:00Added an answer on June 14, 2026 at 7:56 am

    If you are using version 1.8.x or less of jQuery UI then the solution is fairly simple.

    In your style sheet find .ui-tabs-hide and make it look like this :

    .ui-tabs .ui-tabs-hide {
        position: absolute;
        left: -10000px;
    }
    

    And also double check that this exists if you have any problems with the selected panel:

    .ui-tabs .ui-tabs-panel{
        left:0;
    }
    

    The css from jQuery UI is display:none. And that’s what the issue you’re describing is caused from. The carousel plugin needs to determine dimensions, but when display:none is applied the dimensions are 0 x 0.

    NOTE: For some reason, jQuery 1.9 changed this slightly. It no longer adds ui-tabs-hide to inactive panels. If you are already using 1.9, and for some reason can’t go back to 1.8 please let me know and I will help you with that solution (it’s much longer to type, and I am guessing that you’re using 1.8 or earlier).

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I've tracked down a weird MySQL problem to the two different ways I was
I am trying to loop through a bunch of documents I have to put
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into

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.