vodkabears / Remodal

No longer actively maintained.
http://vodkabears.github.io/remodal/
MIT License
2.76k stars 773 forks source link

Using remodal with ajax (pjax) #194

Open ghost opened 8 years ago

ghost commented 8 years ago

This line says that all content will be executed only once, when the page is loaded. So $(document).find(..) isn't executed when navigating by ajax (pjax in my case).

My temporary solution is to wrap every non-event function inside of $(document).ready(..) in $(document).on('click', ...), but I think this should be the core.

goranefbl commented 8 years ago

my fix was to use classes instead of id's for placing ajax fetched content inside divs.

Tusko commented 7 years ago

do you load new items with AJAX (pjax)?

My solution is (add code into ajax success):

     $('.grid').append(html).find('[data-remodal-id]').remodal();