Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为jquery转盘在幻灯片上执行加载图像_Jquery_Carousel - Fatal编程技术网

为jquery转盘在幻灯片上执行加载图像

为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)

我需要在幻灯片放映时重新加载图像,因为它是一个动画gif,需要从开头开始

我可以在当前类上使用if语句单击完成,但这不是我需要的方式,因为我希望幻灯片一进来就加载它。到目前为止,我有下面的

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);