'How can I customize skitter slider show without changing code of skitter.js plugin
I want to show the first image slide when I mouse over the tag with id 1. (When id is 2, show second image.) However, the situation is a little special. I can't change the code of Skitter Plugin itself. Also, it is impossible to use another plug in. I can make a new one without plugin, but I want to use the skitter if possible.
$("#1").hover(
function(e){
$.skitter.fn.jumpToImage(1);
},
function(e){
}
);
As shown in the code above, it is enough to access jumpToImage(), a function that changes the image inside the skitter plugin.
jumpToImage: function(imageNumber)
{
if (this.settings.is_animating == false) {
this.settings.elapsedTime = 0;
this.skitter_box.find('.box_clone').stop();
this.clearTimer(true);
this.settings.image_i = Math.floor(imageNumber);
this.skitter_box.find('.image > a').attr({'href': this.settings.link_atual});
this.skitter_box.find('.image_main').attr({'src': this.getCurrentImage()});
this.skitter_box.find('.box_clone').remove();
this.nextImage();
}
}
The above code is a defined jumpToImage function in the kitter. The problem is that the function cannot be executed because what 'this' points to is different and the necessary variables cannot be found. Can I know how to solve this problem? It would be nice if I could access and use the Skitter object itself, but I don't know how.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
