I created a carousel with views and placed it on a (panel page) on the home page. When the page is loading the carousel does not load and loads as a list trailing down the page. Once the page loads the carousel is fine. This is a major bug that I see everytime I use this module.

Any ideas on a fix or updated module patch for this. I have seen many posts about this issue with no real resolution...

CommentFileSizeAuthor
#5 jcarousel-fix_FOUC-1681538-5.patch926 bytesOgredude

Comments

back from 7’s picture

Where are the maintainers of this project? Should this project not be listed as abandoned? This is a big issue and there is no specific guidance or documentation leading to a solution...

dukem’s picture

Here is a quick and straightforward solution I used:
1. At includes/jcarousel-view.tpl.php add 'style="display:none;"' to the li tag:

<li class="<?php print $row_classes[$id]; ?>" style="display:none;"><?php print $row; ?></li>

So the li's are hidden from the beginning.

2. At js/jcarousel.js add one string:

Drupal.behaviors.jcarousel.attach = function(context, settings) {
  settings = settings || Drupal.settings;

  // If no carousels exist on this part of the page, work no further. 
  if (!settings.jcarousel || !settings.jcarousel.carousels) {
    return;
  }

+ $("ul.jcarousel li").css("display", "");

  $.each(settings.jcarousel.carousels, function(key, options) {

So the li's are shown after page load.

Also you can modify the tpl file so the first element is shown, and others are hidden.

back from 7’s picture

Dude you are AWESOME! THIS WORKED BEAUTIFULLY AND TOTALLY SAVED MY LIFE! Kudos to you bro!!!

Anonymous’s picture

Great WORK !!
Thanks alot ...

Ogredude’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
Category: support » bug
Status: Active » Needs review
StatusFileSize
new926 bytes

Thanks, Dukem, this fixed the FOUC nicely.

Here are the changes from #2 packaged as a patch on the 7.x-2.x branch.

phenaproxima’s picture

The patch in #5 works gloriously for me.

hwasem’s picture

This is FANTASTIC! Thank you so much for the suggestion and then the actual patch. Works great!

back from 7’s picture

Where is the new updated 7.x version? There is none...

sittard’s picture

Please commit patch #5 to the 7.x-2.x branch. It works brilliantly.

dgtlmoon’s picture

Status: Needs review » Reviewed & tested by the community
markpavlitski’s picture

Issue tags: -jcarousel, -not loading, -not working

Removing inappropriate tags.

markpavlitski’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

advernut’s picture

Thank you for the commit! This solution fixed it for me too. But why isn't it updated on the jcarousel module project page? Last version says 2011-Nov-24. Just wondering.

markpavlitski’s picture

@advernut This has been committed to the development branch, 7.x-2.x. We're working towards a new stable release, hopefully in the next few weeks, which will include this fix.

kappaluppa’s picture

This is helpful because when the carousel loads it is all in place. But in my case I have several (6 )carousels and that's the majority of the page. so while I am waiting for all the carousels to load, the page is blank. Any suggestions/solutions/remarks on this?

Thanks