Posted by picardo on September 12, 2009 at 8:06am
3 followers
| 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
Here is a patch for 2.x. It creates namespaces for each plugin.
#3
This has been committed
#4
That was fast. Congrats.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.