Home
> SlideshowBox 1(discontinued version)
> Topic
Javascript image change event.
Posted by user430515
Javascript image change event. August 18, 2011 05:08PM | Registered: 13 years ago Posts: 2 |
I recently asked Jumpeye if it was possible to detect when the Javascript slideshow changed image and I was told that it wasn't possible. After playing around with Firebug I managed to find the elements added to the DOM. So for anybody interested in detecting the change just add this Javascript code to your page (it's not pretty but it works):
var currentImg = "";
(function domSniffer(){
if(document.getElementById("slideshowBoxEmbedCanvasContainer1_template_img")){
if(document.getElementById("slideshowBoxEmbedCanvasContainer1_template_img").src != currentImg){
// The image has been changed
// Do Stuff...
}
}
window.setTimeout(domSniffer, 0500);
})();
var currentImg = "";
(function domSniffer(){
if(document.getElementById("slideshowBoxEmbedCanvasContainer1_template_img")){
if(document.getElementById("slideshowBoxEmbedCanvasContainer1_template_img").src != currentImg){
// The image has been changed
// Do Stuff...
}
}
window.setTimeout(domSniffer, 0500);
})();
Re: Javascript image change event. August 24, 2011 01:16PM | Admin Registered: 13 years ago Posts: 248 |
Actually we said that this is possible only for the flash version. When we said that getting to know when an image is change is only possible for the flash version, we meant that we didn't add a change event that you can use. However if you are able and skilled enough to add your own separate code that allows you to track and see when an image is changed, that's good for you.
PS The code from above only works for some templates that has that id.
PS The code from above only works for some templates that has that id.
Re: Javascript image change event. August 26, 2011 07:46AM | Registered: 13 years ago Posts: 2 |
Sorry, only registered users may post in this forum.