0

好的,所以我让窗帘 X 在我的图像上正常工作,但是在第一次初始加载时,图像会缩小并在顶部消失,然后加载另一个图像,然后它最终会做窗帘 X 图像.. 有什么原因吗?第一个动画甚至与窗帘X效果无关?

        jQuery('.product_show').cycle({
            fx: 'curtainX',
            sync: false,
            speed: 1300,
            timeout: 2000,
            delay: 1000
        });

这是插件的主页:http: //jquery.malsup.com/cycle/ 它在中间的第二行..它看起来就像那样,但它只为第一个动画然后做了一个奇怪的动画在剩下的时间里它工作得很棒。

这是我网站的视频,因为它在我的本地机器上:http ://s1284.photobucket.com/user/IntellectProductions/media/LivestreamforProducers-20130912-131736_446_zpsd84e6c90.mp4.html你可以看到动画是基于那个我发布的代码。

而且我什至创建了一个没有 CSS 的示例,所以我们知道没有 CSS 进入方式,而窗帘仍然这样做:http: //intellectproductions.com/test/html.html

我真的需要这个工作,因为我需要对我的图像进行翻转效果。

4

1 回答 1

1

在@A 的帮助下。Wolff,这是解决方案,因为它需要保持其响应能力并且高度不能硬编码。

    jQuery('.product_block .product_show').each(function() {

        imgHeight = jQuery(this).children(':first').height();
        jQuery(this).children(':first').height(imgHeight);

        val = jQuery(this).attr('class');
        val = val.split(' ');
        //timeout_time = val.substr(val.indexOf('-') + 1);
        timeout_time = val[1].substr(8);

        jQuery(this).cycle({
            fx: 'curtainX',
            sync: false,
            speed: 1300,
            timeout: timeout_time,
            delay: 1000
        });

        turn = turn - 3000;
    });

请注意在此处设置高度:

imgHeight = jQuery(this).children(':first').height();
jQuery(this).children(':first').height(imgHeight);
于 2013-09-12T18:08:28.363 回答