我正在寻找有关 jQuery 可选事件的事件和 ui 对象的信息:选择"和开始"作为参数.我在文档中找不到这个,循环遍历属性也无济于事.
I am looking for info on the event and ui objects the jQuery selectable events: "selecting", and "start" take as parameters. I cannot find this in the documentation and looping through the properties is no help.
$('#content_td_account').selectable({
filter: 'li:not(".non_draggable")',
selecting: function(event, ui) {
}
});
具体来说,我想找出正在选择的元素并检查它们以查看它们的父元素是否相同.我认为这将在 ui 对象中的某个位置.
Specifically I want to find what elements are being selected and check them to see if their parent elements are the same or not. I assumed this would be in the ui object some where.
当一个元素被选中时,它会添加 ui-selected 类.
When an element is selected it gets the ui-selected class added.
所以你可以使用 $(".ui-selected")
这可能不完全有效,但我认为这个想法是这样的:
This might not work exactly but I think the idea would be something like this:
$('#content_td_account').selectable({
filter: 'li:not(".non_draggable")',
selecting: function(event, ui) {
var p = $(this).parent();
$(".ui-selected").each(obj, function() {
if(obj.parent() == p) {
// get rad
}
});
}
});
这篇关于如何使用可选择的 Jquery UI 查找选定的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
用于创建头像的 jQuery/JavaScript 库?jQuery/JavaScript Library for avatar creation?(用于创建头像的 jQuery/JavaScript 库?)
如何做以下掩码输入问题?How to do following mask input problem?(如何做以下掩码输入问题?)
使用 DropKick Javascript 设置值/标签的问题Issues Setting Value/Label Using DropKick Javascript(使用 DropKick Javascript 设置值/标签的问题)
如何对 jquery 插件中的私有方法进行单元测试?how to unit-test private methods in jquery plugins?(如何对 jquery 插件中的私有方法进行单元测试?)
stellar.js - 为垂直滚动网站配置偏移量/对齐元素stellar.js - configuring offsets / aligning elements for a vertical scrolling website?(stellar.js - 为垂直滚动网站配置偏移量/对齐元素?)
jQuery 屏蔽输入插件.当文本框获得焦点时选择所有jQuery masked input plugin. select all content when textbox receives focus(jQuery 屏蔽输入插件.当文本框获得焦点时选择所有内容)