关注公众号:青山有路

jquery仿淘宝加入购物车效果

jquery仿淘宝加入购物车效果:

<script src=”jquery.fly.min.js”></script>

CSS:

.u-flyer{display: block;width: 50px;height: 50px;border-radius: 50px;position: fixed;z-index: 9999;}

JS:

$(function() {

var offset = $(“#end”).offset();

$(“.addcar”).click(function(event){

var addcar = $(this);

var img = addcar.parent().find(‘img’).attr(‘src’);

var flyer = $(‘<img class=”u-flyer” src=”‘+img+'”>’);

flyer.fly({ start: { left: event.pageX, top: event.pageY },

end: { left: offset.left+10, top: offset.top+10, width: 0, height: 0 },

onEnd: function(){

$(“#msg”).show().animate({width: ‘250px’}, 200).fadeOut(1000);

addcar.css(“cursor”,”default”).removeClass(‘orange’).unbind(‘click’);

this.destory();

}

});

});


版权所有丨如未注明 , 均为原创 , 转载请注明jquery仿淘宝加入购物车效果
喜欢 (1)

Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到