如果我对可信项目执行“jquery sortable”,则该项目永远不可编辑。
我应该提到在IE中,每件事都运行正常,我在FF 3.6.8中有这个问题
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script>
<script>
$(document).ready(function(){
$('#sortable').sortable();
});
</script>
</head>
<body>
<span id="sortable">
<p contenteditable="true">test</p>
</span>
</body>
</html>
答案 0 :(得分:6)
或许使用手柄?
<div id="sortable">
<div>
<span class="handle">Perhaps some icon here</span>
<p contenteditable="true">Editable text..</p>
</div>
<div>
<span class="handle">Perhaps some icon here</span>
<p contenteditable="true">Editable text..</p>
</div>
</div>
$("#sortable").sortable({
handle: 'span'
});
P.S。您不应在<p>
内嵌入<span>'s
标记:)