为jquery转盘在幻灯片上执行加载图像
我需要在幻灯片放映时重新加载图像,因为它是一个动画gif,需要从开头开始 我可以在当前类上使用if语句单击完成,但这不是我需要的方式,因为我希望幻灯片一进来就加载它。到目前为止,我有下面的为jquery转盘在幻灯片上执行加载图像,jquery,carousel,Jquery,Carousel,我需要在幻灯片放映时重新加载图像,因为它是一个动画gif,需要从开头开始 我可以在当前类上使用if语句单击完成,但这不是我需要的方式,因为我希望幻灯片一进来就加载它。到目前为止,我有下面的 this.$slides.eq(this.current).addClass('da-slide-current'); var image = new Image(); image.src = "kick.gif"; $("div").click(function () { if ($(this)
this.$slides.eq(this.current).addClass('da-slide-current');
var image = new Image();
image.src = "kick.gif";
$("div").click(function () {
if ($(this).hasClass("da-slide-current")) {
$(this)
$('.da-slide-current > .da-img > img').attr('src', image.src);
}
});
谢谢,但这只适用于加载,而不是当幻灯片出现时,因此,如果幻灯片2上的图像不可用,请显示您的完整代码或创建一个?我说不出你是如何切换幻灯片的。我正在使用codedrops视差滑块(),这是我的小提琴
var image = new Image();
image.src = "kick.gif";
this.$slides.eq(this.current)
.addClass('da-slide-current')
.find("> .da-img > img").attr('src', image.src);