I am trying to use the jCarousel module with a site that uses the Superfish menus and after turning on and off many modules I've narrowed it down to superfish that just breaks the jCarousel display. I'm wondering if anyone else has encountered this and if there is a known fix or alternative. I've attached a screen shot showing the first 3 images of what should be a horizontal display.

CommentFileSizeAuthor
#10 js_files.zip38.73 KBjusyjim
#2 Picture 13.png53.58 KBjusyjim
Picture 12.png87.11 KBjusyjim

Comments

quicksketch’s picture

If you have a particular error from your browser's JavaScript console, that would probably help determine the error.

jusyjim’s picture

StatusFileSize
new53.58 KB

Hi thanks...

Here's a screen shot of the console.

jusyjim’s picture

The message $ is not defined does not apply, that is for a different module that I was testing. Just the other 3...

quicksketch’s picture

Could you disable JavaScript aggregation (admin/settings/performance) and take the screenshot again? Any JavaScript error on the page can bring down all the JavaScript functionality, so the other module you were testing should be disabled if you're not using it.

jusyjim’s picture

Hey, that's interesting... I disable js aggregation and it doesn't cause the error. When I re-enable aggregation the error comes back.

jusyjim’s picture

Seeing that I can't get the error message you wanted, is there anything else I can do to help you find out. Does the fact that disabling js aggregation fixes the problem help you at all? I would hate to have to keep that disabled. Thanks.

quicksketch’s picture

I don't have any ideas that I'm 100% certain on, but my guess is that JS aggregation may be breaking because one of the SuperFish JS files doesn't have a blank line at the end of it. I don't *think* this is actually a requirement for the JS aggregator to work, but what's happening is the aggregated JS file contains a syntax error, breaking all other JS on the page. The individual non-aggregated files do not have an error though, it's strange.

Do you have any modules that compress the JS code in addition to aggregating it, such as JSMin? Aggregation itself rarely causes a problem, but attempting to compress the JS frequently causes problems.

jusyjim’s picture

Hi, no JS min or other JS tools.

Here are all the scripts loaded:

    <script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?Y"></script>
<script type="text/javascript" src="/misc/drupal.js?Y"></script>
<script type="text/javascript" defer="defer" src="/sites/all/modules/admin_menu/admin_menu.js?Y"></script>
<script type="text/javascript" src="/sites/all/modules/dhtml_menu/dhtml_menu.js?Y"></script>
<script type="text/javascript" src="/sites/all/modules/panels/js/panels.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/jquery.hoverIntent.minified.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/jquery.bgiframe.min.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/superfish.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/supersubs.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/supposition.js?Y"></script>
<script type="text/javascript" src="/sites/all/libraries/superfish/sftouchscreen.js?Y"></script>
<script type="text/javascript" src="/sites/all/modules/custom_search/custom_search.js?Y"></script>
<script type="text/javascript" src="/sites/all/modules/jcarousel/js/jquery.jcarousel.min.js?Y"></script>
<script type="text/javascript" src="/sites/all/modules/jcarousel/js/jcarousel.js?Y"></script>
quicksketch’s picture

From your screenshot attached to #2, it looks like SuperFish is throwing the error before any other JS on the page finds any errors. My guess is that it's having a snowball effect and breaking the rest of the JS on the page. I would suggest turning back on aggregation, look at the error console again, and try to figure out what is causing the error by looking at the line number of the file that is throwing the error.

jusyjim’s picture

StatusFileSize
new38.73 KB

Hi,

I did that and came back with the same errors (below)

Error: missing ; before statement
Source File: http://nomadpress.net/sites/default/files/js/js_71c59862a24499f78041ebbc6960e1c5.js
Line: 786
Source Code:
* Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget - LAST UPDATE: MARCH 23rd, 2011 
Error: jQuery is not defined
Source File: http://nomadpress.net/homefront
Line: 40
Error: jQuery is not defined
Source File: http://nomadpress.net/homefront
Line: 45
Error: jQuery is not defined
Source File: http://nomadpress.net/homefront
Line: 56
Error: Drupal is not defined
Source File: http://nomadpress.net/sites/default/files/js/js_062c98641f9f4a42e8d607705a79a6b2.js
Line: 3

I've attached the 2 .js files for your reference.

quicksketch’s picture

So the first error makes this problem pretty apparent:

})(jQuery); // plugin code ends;/*
* Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget - LAST UPDATE: MARCH 23rd, 2011
*

On line 785, the open comment "/*" is put on the end of the line instead of being on the next line. This is probably a bug in Drupal core, but you can fix it either by:

- Putting a new line at the bottom of the Supersubs JS file.
- Putting a new line at the top of the Superfish JS file.

I can't know the exact name of the file from your attachments. But you should be able to figure that out easily enough.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing this issue after a lack of activity.