Jquery错误偏移量(...)未定义

时间:2016-12-22 20:14:15

标签: javascript jquery

$('#add_to_cart_btn').unbind().on('click', function() {
        //var cart = $('.cart_r');
        var imgtodrag = $('#bzoom').find('img').eq(0);
        if (imgtodrag) {
            var imgclone = imgtodrag.clone().offset({
                top: imgtodrag.offset().top, left: imgtodrag.offset().left
            }).css({
                'opacity': '0.5', 'position': 'absolute', 'height': '150px', 'width': '150px',  'z-index': '100'
            }).appendTo($('body')).animate({
                'top': $('.cart_r').top + 10, 'left': $('.cart_r').offset().left + 10, 'width': 75, 'height': 75
            }, 1000, 'easeInOutExpo');
            setTimeout(function () {
                //cart.effect('shake', { times: 2 }, 200);
            }, 1500);
            imgclone.animate({
                'width': 0, 'height': 0
            }, function () {
                $(this).detach();
            });

            $("html, body").animate({ scrollTop: 10 }, 1000);


        }
        return false;
    });

显示此错误TypeError: $(...).offset(...) is undefined所有准备好添加jquery.min.js但不能在任何浏览器上运行。任何人都可以帮助我。在此先感谢

0 个答案:

没有答案