javascript - Ajax lazy loading, accordion button not activated -


i'm lazy loading pages in wordpress using ajax. working fine apart accordion buttons. if access page directly works fine, if come page , accordion page lazy loaded buttons wont' active, though content present in source.

using javascript, possible initialize button?

i can't post link although i've included screenshot of source handles it.

the accordion

unexpanded

expanded

i new js, i'm not sure how can handle this. have insight?

edit:

i've since written this

<script> jquery(function($) { $('omsc-accordion').click(function() {     $('.omsc-accordion').addclass('.omsc-toggle omsc-expanded'); }) }); </script> 

but nothing. shold working? i'm brand new jquery

since content loaded via ajax, try way access click handler

$(document).on('click', '.omsc-accordion', function() {     $(this).addclass('omsc-toggle omsc-expanded'); }); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -