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.
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
Post a Comment