[resolved] Agree / Disagree with I-Frame in Pop-Up on Image Click? (3 posts)

  1. jasontd
    Posted 2 years ago #


    I am trying to enable something that seems like it should be fairly simple, and I need some help. I am developing a landing page that has three identical images on it at different places. Each image, when clicked, should link to the site's purchase page. Before sending the user to that page, however, there should be a popup window with the terms and agreements displayed in an i-frame and with "Agree" / "Disagree" options. Could you please help me figure out how to do this?

    I was able to enable this behavior for one link with the Agreement plugin (http://wordpress.org/plugins/agreement/), but it won't work with more than one per page.


  2. bcworkz
    Posted 2 years ago #

    I've no idea what the plugin does, there's several ways to handle popups. It's possible the plugin could be hacked to work with multiple links per page.

    The code is not too complex, so it's probably easier to start from scratch than figure out someone else's code. It's all done with javascript. I suggest always keeping JS in a separate file which is enqueued with PHP wp_enqueue_script(). As opposed to echoing out script inside of <script> tags.

    Open the popup with window.open(). The popup does whatever then uses window.opener.location.href = url; (or something like that - untested) to redirect the parent window to a new location when it's appropriate. Then the popup closes itself with window.close()

  3. jasontd
    Posted 2 years ago #

    Thanks for the help with the JavaScript on that. The assistance is much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic