Without seeing more code it will be hard to find the exact issue, but here's a guess:
$(document).on("click", "span.accordionOn", function(event){
$(this).toggleClass('accordionOff'); //I merged the 2 functions
$(this).parents(".toggleOuterCustom");
$(this).parents(".toggleOuterCustom").find(".lHeight").toggleClass('lHeighttranslate');
return false;
});
Try the above code. If this works then the issue is as following:
- You bind the event handler to all
span.accordionOn
elements that are currently in the document - However, if you add new
span.accordionOn
elements after this, the event will not be bound to them - The
on
event will work for all current and futurespan.accordionOn
items that will ever be in the document, which solves this issue