I am using jQuery 1.4.2. Using the CSS selector "span.accordionOn", I am handling a click event. On screen one, it is working fine. Where as when I navigate to next screen, the functions are not getting called.
The jQuery handlers are as shown below. I am keeping them in a js file and loading the js file for every page load.
$("span.accordionOn").click(function(event){
$(this).parents(".toggleOuterCustom");
$(this).parents(".toggleOuterCustom").find(".lHeight").toggleClass('lHeighttranslate');
return false;
});
// toggle link icon
$('span.accordionOn').click(function(){
$(this).toggleClass('accordionOff');
});
Without seeing more code it will be hard to find the exact issue, but here's a guess:
Try the above code. If this works then the issue is as following:
span.accordionOnelements that are currently in the documentspan.accordionOnelements after this, the event will not be bound to themonevent will work for all current and futurespan.accordionOnitems that will ever be in the document, which solves this issue