jquery - Click anywhere closes MagnificPopup ajax box -
whenever i'm trying fill login form (which magnific pop ajax box) gets closed in first instance of click.
main.html
$(document).ready(function() { $('.ajax-popup-link').magnificpopup({ type: 'ajax', aligntop: false, overflowy: 'scroll' }); });
<a class="simple-ajax-popup-align-top" href="result.php">try me</a><br>
result.php
<div> <form action="..." method="post"> email: <label class="field_container"> password: <input type='text' name='cust_username' id='username' maxlength="12" style="width: 250px; height: 30px" /></label> <label class="field_container"> password: <input type='password' name='cust_password' id='password' maxlength="12" style="width: 250px; height: 30px" /></label> <input type='submit' name='submit' value='login' /> </form> </div>
make sure page "ajax-ing" isn't containing more info or tags needed. e.g. should clean this:
<div> <h3>heading</h3> <p> text </p> </div>
in other words, try avoiding multiple <div>
s , don't include <html>
, <body>
etc. unfortunately lead behaviour described in question, of popup closing. assume it's because has trouble determining content is, thinks clicked outside content => closes popup.
closeoncontentclick: false
is set default won't help, cleaning code simple possible might.
i mention alternative: http://nyromodal.nyrodev.com/, seems handle things way smoother, , includes content filtering id.
Comments
Post a Comment