由网友(独守寂寥)分享简介:我有这个code:$('body').live('mousemove mouseover', function () {$("#parent_task").multiselect({selectedList: 4,click: function(event, ui){var cntInput=$("#child_tas...
我有这个code:
$('body').live('mousemove mouseover', function () {
$("#parent_task").multiselect({
selectedList: 4,
click: function(event, ui){
var cntInput=$("#child_task").multiselect("widget").find('input[value='+ui.value+']').parent('label');
if(ui.checked){ cntInput.hide() }else{cntInput.show() }
}
}).multiselectfilter();
$("#child_task").multiselect({
selectedList: 4,
click: function(event, ui){
var cntInput=$("#parent_task").multiselect("widget").find('input[value='+ui.value+']').parent('label');
if(ui.checked){ cntInput.hide() }else{cntInput.show() }
}
}).multiselectfilter();
});
如何可能AJAX加载后开始多选,现在我使用 $('身体')。住(鼠标移动鼠标悬停',函数(){
但鼠标或鼠标移动后招标,它看起来并不好,存在另一种方式感谢你;)
链接插件 http://www.erichynds.com/jquery/jquery-ui -multiselect小部件/
对不起,我的英语:)
how is possible to start multiselect after ajax load , right now i'm using $('body').live('mousemove mouseover', function () {
, but is biding after mouse over or mouse move , and it doesn't look good , exist another way ? thank you ;)
link to plugin http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
Sorry for my english :)
推荐答案
那么我想你可以调用多选()AJAX完成,或在succcess功能后:
Well i think you could call multiselect() after AJAX completes or in the succcess function:
$.ajax({
url: yoururl,
method: 'POST',
success: function(data){
//do what you need to do and then initialize the multiselect
$("#parent_task").multiselect({
selectedList: 4,
click: function(event, ui){
var cntInput=$("#child_task").multiselect("widget").find('input[value='+ui.value+']').parent('label');
if(ui.checked){ cntInput.hide() }else{cntInput.show() }
}
}).multiselectfilter();
$("#child_task").multiselect({
selectedList: 4,
click: function(event, ui){
var cntInput=$("#parent_task").multiselect("widget").find('input[value='+ui.value+']').parent('label');
if(ui.checked){ cntInput.hide() }else{cntInput.show() }
}
}).multiselectfilter();
}
在这样的DOM是准备就绪,你可以调用该插件。
In this way your DOM is ready and you can call the plugin.
相关推荐
最新文章