Trigger popup with JS
-
Is there a way to trigger the modal with JS on document ready?
Situation:
All posts are supposed to open in a modal. Therefore, when a permalink (of a post) is visited, the actual page loaded is the one with the post listing (custom template) and the post should open in a modal. I would like to avoid the method of redirecting to open the modal with a url parameter, because these post listings appear on different page templates, depending on their category etc.
preferred way would be:
- load page with post list (I use the single-post template for this)
- based on url, trigger actual post to open in modal
I tried with a simple jQuery.document(#id-of-link).click() but this causes to fire the click event again and again, once the modal shows up
The topic ‘Trigger popup with JS’ is closed to new replies.