【问题标题】:How to fix a widget in the dashboard plugin?如何修复仪表板插件中的小部件?
【发布时间】:2012-06-16 02:50:10
【问题描述】:

我正在尝试调整http://www.gxdeveloperweb.com/dashboardplugin/demo/dashboard.html 此处演示的插件以满足我的需要。

最紧迫的是小部件必须有参数(例如在配置文件中)——小部件位置在方案上是“固定的”或“不固定的”。

那么我该如何做到这一点以及如何使小部件不可拖动?

非常感谢!

【问题讨论】:

  • 谢谢!是的,我做到了。基本上对所提供的功能感到满意,并且只需要能够修复其中一列中的小部件。链接的答案说的是另一件事。

标签: jquery jquery-plugins dashboard


【解决方案1】:

您可以只添加具有items 属性并且仅具有不具有固定类的项。

这是一个小提琴: http://jsfiddle.net/MadLittleMods/DUSKm/

以及这里的简单代码:

jQuery:

$('#container').sortable({
    items: '.item:not(.fixed)'
});
$('#container').disableSelection();
​

HTML:

<div id="container">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <div class="item fixed">Item 3</div>
    <div class="item">Item 4</div>
</div>​

【讨论】:

    猜你喜欢
    • 2011-11-24
    • 2014-04-02
    • 2013-11-05
    • 1970-01-01
    • 2018-04-04
    • 1970-01-01
    • 2016-07-15
    • 2013-06-03
    • 2011-02-18
    相关资源
    最近更新 更多