我想用一个简单的按钮来创建一个页面,当他试图点击它时,它会远离用户.我们称之为Run away按钮?
是否有一个简单的’jQuery’代码段允许我这样做?
问候,卡兰米斯拉
$('button').hover(function(){ $(this).css('top',rand(1,1000) + 'px').css('left',1000) + 'px');});
$('button').hover(function()
{
$(this).css('top',rand(1,1000) + 'px').css('left',1000) + 'px');
});
不需要插件.