61,112
社区成员
发帖
与我相关
我的任务
分享
<style type="text/css">
div{border: 1px solid red;width: 200px;height: 100px;display: inline-block;}
.right,.left{width: 200px;height: 500px;}
.right{float: right;}
.left{float: left;}
</style>
<div class="left">
<div>1</div><div>2</div><div>3</div><div>4</div><div>5</div>
</div>
<div class="right"></div>
<script type="text/javascript">
$(".left div,.right div").click(function(){
cli()
})
function cli(){
$(".left>div").click(function(){
$(this).appendTo(".right")
})
$(".right>div").click(function(){
$(this).appendTo(".left")
})
}
cli()
</script>