-1

I have a page showing a list of events with anchors which trigger popups onclick. How can I trigger these modal popups when an anchor is clicked on another page?

How can I pass the values on, I suppose, and trigger the click?

For example, anchor on event page I'd like to trigger a popup for from another page:

<a class="event " href="#" data-onclick="popup" data-color="#000" data-event-id="3">
        <div class="event-inner" data-event-id="3"></div>
</a>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
vulgarbulgar
  • 845
  • 1
  • 13
  • 28
  • here is example page of event timetable - how can i trigger a popup of a particular event from another page upon page load? http://rikdevos.com/demos/wordpress-responsive-timetable/ – vulgarbulgar Jun 22 '15 at 21:16

1 Answers1

0

Your webpage and Javascript won't have any knowledge of the anchor tags if they aren't on the current page (or even in another tab, for that matter). If you really need that information available on the second page, you can try passing it through the query string like this.

Otherwise, you can save JSON data for your events on the server and retrieve them for every page that needs them. If you're not familiar with JSON and AJAX, you can find a tutorial here. If you're using jquery, it has a great API for AJAX calls.

Community
  • 1
  • 1
LdTrigger
  • 143
  • 1
  • 8