twitter bootstrap - jQuery: Dynamically Adding Glyphicon -


i having slight functioning issue in firefox w/ jquery glyphicon. used bootstrap build portfolio , used jquery .load function load portfolio pages dynamically when click on them.

i added jquery .append function append glyphicon close icon on each opened page, when open , close them on page in portfolio section keeps adding multiple glyphicons. adds more , more open , close.

what happening here? can help?

my code:

$(".close").append('<span class="glyphicon glyphicon-remove-circle"></span>'); $(".glyphicon-remove-circle").click(function(e) {     $(".portfoliocontent").fadeout(); }); 

you can try this:

$(document).on('click','.glyphicon-remove-circle',function(){    $(".portfoliocontent").fadeout(); }); 

or way too:

$('.close').on('click','.glyphicon-remove-circle',function(){    $(".portfoliocontent").fadeout(); }); 

Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -