1

我的代码使用 jquery ui-helper 生成以下内容。我想从 li 标签中隐藏/删除 1000: 和 1001:。另外我想禁用可拖动功能,我可以这样做吗?

   <ul class="available connected-list" style="height: 101px;">

<li class="ui-helper-hidden-accessible"></li>

<li class="ui-state-default ui-element ui-draggable" title="1000:薯仔咖哩雞 Curry Chicken" style="">
<span class="ui-helper-hidden"></span>1000:薯仔咖哩雞 Curry Chicken
<a href="#" class="action">
<span class="ui-corner-all ui-icon ui-icon-plus"></span>
</a>
</li>

<li class="ui-state-default ui-element ui-draggable" title="1001:香脆炸鸡翼 Crispy Fried Chicken Wing" style="">
<span class="ui-helper-hidden"></span>1001:香脆炸鸡翼 Crispy Fried Chicken Wing<a href="#" class="action">
<span class="ui-corner-all ui-icon ui-icon-plus">
</span>
</a>
</li>

</ul>
4

1 回答 1

1

看到这会有所帮助, http://jsfiddle.net/KLpea/

    $( ".your_selector" ).draggable( "disable" ); // TO disable the Jquery UI draggable & Disable the draggable with your specific condition

    $("ul li").html(function(i, html) {
        return html.replace(/\d*:/, "");
    });
于 2013-11-07T05:25:25.543 回答