close
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<style type="text/css">
li{
padding: 20px;
background-color: #0af;
margin: 10px 0;
list-style: none;
width: 300px;
}
</style>
</head>
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<script type="text/javascript">
$('li').on('click',function(){
$(this).animate({
opacity:0,
'margin-left':'+=80'
},500,function(){
$(this).remove();
});
});
</script>
</body>
</html>
全站熱搜
留言列表