In my plugin some elements will close the sidebar. For example if in a sidebar there is a list:
<ul>
<li>element 1</li>
<li>element 2</li>
<li>element 3</li>
</ul>
li
elements will trigger the closing animation.
My issue is that if some elements are loaded asynchronously, the plugin won't "see" those elements and the animation won't be triggered.
It's not just AJAX
I'm talking about all elements loaded dynamically!
The code is really simple and here there is an example:
var $elements = 'li';
$elements.click(function() {
$sidebar.animate({
//animation
});
});
How can I make those elements visible to the plugin?
Here the complete code https://github.com/dcdeiv/simple-sidebar/blob/master/jquery.simplesidebar.js