我遇到了一个问题,让我的div变得可排序使用Scriptaculous的拖放库。
<pre id="leftcol">
<div id="id0"><h3>Date and Time</h3><div class="moduleContent"></div></div>
<div id="id14"><h3>Calculator</h3><div class="moduleContent"></div></div>
</pre>
<script type="text/javascript">
Sortable.create("leftcol", {tag:$$('div'), treeTag:$$('pre')});
</script>当我尝试使用Safari的Web Inspector进行调试时,我得到了以下错误:TypeError: Result of expression 'tagName.toUpperCase' [undefined] is not a function. dragdrop.js:932
问题是在dragdrop.js文件中还是在我的代码中,如果是在我的代码中,我如何修复它?谢谢。
发布于 2009-11-08 13:51:25
Sortable.create方法期望选项tag和tagTree只是两个字符串,而不是一组DOM元素:
Sortable.create("leftcol", {tag:'div', treeTag:'pre'});试试here吧。
https://stackoverflow.com/questions/1695471
复制相似问题