Home › Forums › CSS › Anythingslider with embedded videos – loading twice › Re: Anythingslider with embedded videos – loading twice
May 7, 2012 at 11:01 pm
#102474
Member
Well, the issue is actually that the video extension is triggered on the window load event, which is why you see it load, then reload.
The video extension really needs to be rewritten, but I just haven’t had the time or the motivation to get it done. But, I think the easiest solution would be to modify the video extension slightly….
First remove the following code from the end of the file:
// Initialize video extension automatically
jQuery(window).load(function(){
jQuery('.anythingBase').anythingSliderVideo();
});
Then add the following to the AnythingSlider initialization code:
$('#slider').anythingSlider({
onInitialized : function(e, slider) {
slider.$el.anythingSliderVideo();
}
});
This will initialize the video extension immediately after the slider has set itself up and likely before the page has completely loading.