jquery - add tabs which are closable with dynamic content -
hi asked question. didn't perfect solution this. want add closeable tabs come dynamically. see plugin demo plugin. pl z need dis. code
$(document).ready(function(){ $('ul.url_list > li > a').click(function(){ var me = $(this); var url = me.attr('data'); var ppr = me.html(); $('.dynamic_content > iframe').remove(); $('.dynamic_content').append('<iframe src="' + url + '" width="100%" height="300px"></iframe>'); $('ul.maintabs') .append('<li><a href="#" data="'+url+'"> ' + ppr + ' </li></li>') }); $('ul.maintabs > li > a').click(function(){ var re = $(this); var vrl = me.attr('data'); $('.dynamic_content > iframe').remove(); $('.dynamic_content').append('<iframe src="' + url + '" width="100%" height="300px"></iframe>'); }); });
Comments
Post a Comment