Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Some themes (eg. http://themeforest.net/item/elegantica-responsive-business-drupal-theme/...) load jQuery as one of their theme's script files. InfiniteCarousel.js gets loaded as a module script file, which, by default, come before the theme script files.
jQuery needs to be loaded before infiniteCarousel.js gets loaded or else the back and forward arrows don't work.
Solution is to load infiniteCarousel.js as a theme script, with a big weight.
galleryformatter.module, line 354:
if($num_of_images > 1){
$options = array(
'weight' => 1000, // High number to push this file to the bottom of the list
'group' => JS_THEME
);
drupal_add_js($modulepath . '/theme/infiniteCarousel.js', $options);
drupal_add_js($modulepath . '/theme/galleryformatter.js', $options);
}
Comment | File | Size | Author |
---|---|---|---|
#1 | 1992304-1-load-js-last.patch | 855 bytes | kscheirer |
Comments
Comment #1
kscheirerHere you go, as a patch. Seems like a benign change.
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer commentedThanks for the report and patch @kscheirer - (and apologies for the total silence here).
Loading jQuery from a theme is not a good practice, and I wouldn't be surprised if it caused issues with other modules...
It's good you opened this so people can find out about it if they suffer from such a theme, but this isn't going to get in sorry.