我希望我的网页上有两个部分,可以左右拖动:
<style>
#sortableitem {
width: 100px;
height: 70px;
float:left;
list-style-type: none;
}
.content {
background:lightgrey;
}
.header {
background:grey;
}
<style>
<ul id='sortable'>
<li id='sortableitem'>
<div class='header'>ITEM 1</div>
<div class='content'>Content here</div>
</li>
<li id='sortableitem'>
<div class='header'>ITEM 2</div>
<div class='content'>Content here</div>
</li>
</ul>
<script>
$(document).ready(function () {
$("#sortable").sortable();
});
</script>
这里已经可以工作:http://jsfiddle.net/gTUSw/
然而,我只想通过标题栏拖动。我有一些需要被选中的内容。
我该如何使拖动通过标题栏进行,但仍能在内容区域正常控制鼠标事件?