Download & Extend

Multiple slideshows on the same page; only the most recently added one works

Project:Views Slideshow
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I have two slideshows--one is single frame, the other thumbnail hover--on the same page. The most recently added one is single frame, and it causes the thumbnail hover's scripted functionality to break down. Hovering no longer changes the picture in the breakout element nor does it automatically switch by itself.

Any workarounds you could suggest?

Comments

#1

Reviewing the code I realized that the script is not namespaced. This is a serious problem, I think, and it would be very easy to fix it by making the script into a simple jQuery plugin. Thus:

jQuery.fn.views_slideshow = function(num_divs, timer_delay, sort_order, fade, fade_speed, fade_value){

// all the code goes here

};

...and then you could simply invoke it by:

$('.example').views_slideshow(10, 5000, 1, true, "fast", 0.25);

I was going to just implement a custom solution, but I decided to patch and rewrite the javascript files instead. The javascript of this module needs a little love.

#2

Version:6.x-1.x-dev» 6.x-2.x-dev
Status:active» needs review

Here is a patch for 2.x. It creates namespaces for each plugin.

AttachmentSize
namespace-575410-1.patch 20.59 KB

#3

Status:needs review» fixed

This has been committed

#4

That was fast. Congrats.

#5

Status:fixed» closed (fixed)

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