开发者

Jquery inside modal box function

I use next function to build Modal box. And I need jquery combo box inside that modal box.

      function launchModal开发者_如何学运维(id) {
        jQuery('body').append('<div id="catmodal" title=""><select id="ac_s1"><option value="Home Security"></option></select></div>');
        jQuery('#'+id).dialog({
          resizable: false,
          height: 370,
          width: 900,
          modal: true,
          buttons: {Close: function(){jQuery(this).dialog('close');}},
          close: function(event, ui){jQuery(this).dialog('destroy').remove();}
        });

And I wrote

jQuery(document).ready(function(){ jQuery("#ac_s1").combobox(); }

But it works only outside modal box function, if I insert inside of modal box function content, it stops working and simple html Select menu appears.

How to solve it???


give an id to modal div - modaldiv

write html in that

try $('#modaldiv').html(.......) or $('#modaldiv').text(.......)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜