In jquery modal view idtab link is not working
If I add idtab in main page it works fine. But when I add idtab in modal window, all the tab entries are showing and clicking on link doesn't work.
Its sample code I tested. Can you point me to what I am doing incorrectly here.
var str = $("<div id="divid" class="panel">' +
'<div class="panelname"><span class="panellabel">Header</span></div>' +
'<ul class="idTabs"><li><a href="#jquery">jQuery</a></li><li><a href="#official">Tabs 3</a></li></ul>' +
'<div id="jquery">JQUERY TAB</div><div id="official">NEXT TAB</div>' +
'</div>');
this.append(str);
str.jqm({modal:true,overlay: 0});
str.jqmShow();
str.draggable(开发者_StackOverflow社区);
$('#divdiv').idTabs();
You didn't provide a ton of detail, but it sounds like the problem you are having is that idtabs initializes the tabs in the main content area automatically when the page is finished loading, but since the idtabs don't yet exist in the modal window, they aren't automatically initialized. I'm pretty sure this is the plugin you're referring to - http://www.sunsean.com/idTabs/ , and if that's the case, you simply need to call the initialization function on the tabs that get inserted into the modal window after the modal is opened.
$("."+idTabs).idTabs();
精彩评论