Forums

SimpleModal Login
[resolved] invoke popup from jquery (8 posts)

  1. petoz
    Member
    Posted 1 year ago #

    Hi, i want invoke the popup after a slide of a jquery button

    I've tried this solution but don't work...any hint or solution ?

    sound like this:

    jQuery(document).ready(function() {
      $loginregister = false;
      	 jQuery(".btn_select").stop().animate({marginLeft: '0px' });            
    
     jQuery(".btn_select").click(function(){
    	jQuery(this).blur();
    			if ($loginregister == false){
    		 jQuery(this).stop().animate({marginLeft: '70px' });
    		 jQuery(window.location).attr({
                                                  href: '/wp-login.php',
                                            'class': 'simplemodal-login'
                                                    });
    		 $loginregister = true;
    			                         }else{
     jQuery(this).stop().animate({marginLeft: '0px' });
    				$loginregister = false;
    			                          }
    			         return false;
    		                });
      });
  2. Eric Martin
    Member
    Posted 1 year ago #

    The following should invoke the modal dialog:

    $('.simplemodal-login').trigger('click.simplemodal-login');

  3. petoz
    Member
    Posted 1 year ago #

    this work, but worked only the first time :(

    there is a " reset" for this function ?

    I'm coding with jQuery only about a week... sorry !

  4. petoz
    Member
    Posted 1 year ago #

    Solved! thank you very much !

  5. MG7282
    Member
    Posted 1 year ago #

    How did you solve this? I am trying to password protect a page by triggering the login box, but it's not popping up. Any other suggestions?

    This is what I did:

    `<?php
    if (is_user_logged_in() ) {
    <!-- display page -->
    }
    else {
    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery('.simplemodal-login').trigger('click.simplemodal-login');
    });
    </script>
    }`

  6. petoz
    Member
    Posted 1 year ago #

    try with .bind() instead the .trigger()

  7. MG7282
    Member
    Posted 1 year ago #

    Nope, its not doing it..

  8. petoz
    Member
    Posted 1 year ago #

    sorry, i solved with .bind() here works fine

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic