0

我试图让图像在页面加载时像在标题下方的中间区域一样向上滑动。到目前为止,这是我的 jQuery:

$(function() {
        $("#product_img").on('load', function() {
        $(this).show('slide', {
            direction: 'up' }, 2000); });
});

我也试过这个:

$("#product_img").animate({'up':200},255,'linear', function() {console.log('Done Animation'); })

它在 Chrome 调试器中打印“完成动画”..但它不显示图像。:/ 现在的图像只是#product_img { display: none; } 在我的 CSS 中。有什么我想念的吗?丁:

谢谢你的帮助!

4

2 回答 2

0

试试这个:

$("#product_img").slideUp(1000, 'linear', function(){});

更新。这将隐藏图像。试试 slideDown 代替:

http://jsfiddle.net/qeTM2/2/
于 2013-06-28T19:25:08.690 回答
0

尝试使用这个:

$("#product_img").one('load', function () {
    $(this).slideDown(2000);
}).each(function () {
    if (this.complete) $(this).trigger('load');
});

它在这里工作:http: //jsfiddle.net/bbR8Y/2/

于 2013-06-28T19:33:57.533 回答