javascript - jquery colorbox 'inline' modal opening for first time only -
i using jquery colorbox 'inline'. opening first time specific link.
<a class="addfile inline" href="#inline_content"> <img src="img/nav-icons/icon_plis.png" alt=""> add file </a>
with jquery written on
$(".inline").colorbox({inline:true, width:"40%",href:"#inline_content"});
but when trying open inline content (#inline_content2) different link(s) on same page, previous inline content (#inline_content) opening. please me resolve issue. -thanks
in click event
$('.inline').on('click',function(e){ e.preventdefault(); $(this).colorbox({inline:true, width:"40%",href:$(this).attr("href")}); });
or can use .each();
$('.inline').each(function(){ $(this).colorbox({inline:true, width:"40%",href:$(this).attr("href")}); });
if both of them not work make specific class each anchor
$(".inline").colorbox({inline:true, width:"40%",href:"#inline_content"}); $(".inline1").colorbox({inline:true, width:"40%",href:"#inline_content1"}); $(".inline2").colorbox({inline:true, width:"40%",href:"#inline_content2"}); ... etc
Comments
Post a Comment