【问题标题】:Problem with Sortables in ScriptaculousScriptaculous 中的可排序问题
【发布时间】:2010-12-14 07:21:50
【问题描述】:

我在使用 Scriptaculous 的拖放库让我的 div 变得可排序时遇到问题。

<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 文件中还是在我的代码中,如果在我的代码中,我该如何解决?谢谢。

【问题讨论】:

    标签: javascript prototypejs scriptaculous typeerror


    【解决方案1】:

    Sortable.create 方法期望选项 tagtagTree 只是两个字符串,而不是一组 DOM 元素:

    Sortable.create("leftcol", {tag:'div', treeTag:'pre'});
    

    试试看here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-14
      • 1970-01-01
      • 1970-01-01
      • 2019-07-19
      • 2014-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多