WordPress.org

Forums

Easy Modal
[resolved] Refresh Page after modal closes (8 posts)

  1. jiipsijack
    Member
    Posted 10 months ago #

    Hi there, is there anyway to refresh the page that i opened the modal from when I close it? Ideally just with a single Modal not all of them. This functionality would be an amazing addition to an already great plugin, Thanks again for the quick support I received last time and thanks in advance for any help you can give me on this question.

    https://wordpress.org/plugins/easy-modal/

  2. danieliser
    Member
    Plugin Author

    Posted 10 months ago #

    You can use jQuery to override the close functionailty of that one modal.

    something like this should do the trick.

    jQuery('#eModal-1 .close-modal').click(function(e){
        e.preventDefault();
        location.reload();
    });
  3. jiipsijack
    Member
    Posted 10 months ago #

    Thanks for such a quick reply, would you mind telling me whereabouts I should add this? I'm relatively new to jquery stuff at the moment. Would I be modifying your plugin or putting this somehwere in my theme? Thanks again.

  4. danieliser
    Member
    Plugin Author

    Posted 10 months ago #

    it either needs to be added to your themes Javascript files or before the /body tag between <script></script>

  5. jiipsijack
    Member
    Posted 10 months ago #

    Hi again, I've added your script to my header, but the page doesn't refresh when I close my modal window, I added it in using "css and js toolbox" plugin, it shows up correctly but I'm not seeing any change. I've tried it with plain <script> tags and with <script type="text/javascript> The eModal I'm closing contains an iframe of another page on my site, don't know if that makes any difference. The page is my shopping cart page, if you go to this example product - http://hoofpick.me/archives/product/tekna-ergonomic-girth and add it to your cart then try the "register" link you can see the Modal window. Once again, thank you so much for your help. Can't wait to have this working.

  6. jiipsijack
    Member
    Posted 10 months ago #

    Oh and upon registering, the user will see a new page telling them to close the window to continue with their purchase. I just haven't finished that part yet. :)

  7. jiipsijack
    Member
    Posted 10 months ago #

    Sorry, one more update, I've reset the register link to its standard form (no Modal Window) as people have tried to register on the site but I've pasted the source code from the page here: https://gist.github.com/jiipsijack/65f140d2ed56ad3a0fdd if you need to check it out.

  8. danieliser
    Member
    Plugin Author

    Posted 10 months ago #

    Your script code needs to be just before the closing /body tag, at the end of the page not the beginning.

    Hope this helps.

Reply

You must log in to post.

About this Plugin

  • Easy Modal
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.