I'm using a pageless solution for displaying a list of locations. Some of these locations include this jQuery popup for additional data to be displayed in the box. The problem however, is that on following ajax appends, the new locations added to continue the page going down don't maintain the popup functionality.
How do I initialize the new popups added to the page?
<div data-role="popup" id="@l.location_id" data-corners="false" data-tolerance="50,30">
Content
</div>
Thanks!
When the page loads and jQuery mobile is initialized, it'll look for any divs with the attribute data-role="popup"
and initialize the popup. The problem is that this code runs once on page load and dynamically created divs are not registered. You can however initialize the popup widget programmatically by doing
$(selector).popup()
selector
can be the id
of the newly added div.