Support » Plugin: SimpleModal Login » [Plugin: SimpleModal Login] Invoke from JS

  • Hi,

    i couldn’t figure out how to invoke simplemodal-login with jQuery.

    I use a PHP Widget to easy edit the PHP without changing themefunctions.

    The code is

    `<?php
    if (is_user_logged_in() ) {
    /* shortened code: show page */
    }
    else {
    echo '<script type="text/javascript">';
    echo 'jQuery(document).ready(function($) {';
    echo '$(\'.simplemodal-login\').trigger(\'click.simplemodal-login\')';
    echo '})';
    echo '</script>';
    }
    ?>`

    But when opening the page, there are no JS errors and no simplemodal-login for not logged in users.

    Even tried with
    echo '$(\'.simplemodal-login\').bind(\'click.simplemodal-login\')'; but no success.

    http://wordpress.org/extend/plugins/simplemodal-login/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter MajorXX

    (@majorxx)

    okay, i bypassed PHP and used the jQuery Skript only:

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    
    <script type="text/javascript">
        jQuery(document).ready(function() {
        jQuery('.simplemodal-login').trigger('click.simplemodal-login')
    });
    </script>

    but that didn’t work either.
    I replaced the $ with jQuery. i tried “bind” as a replacement for trigger. No errors, no success.

    i tried a different approach with JS:

    <script>
    windows.location.href 'wp-login.php'
    </script>

    That works partially. it opens wp-login.php instantly, but without simplemodal login because i can’t use ‘class=”simplemodal-login”‘ with the windows location.href syntax.

    How do i call SimpleModal Login direct ?
    Found that question many times on the net, but no answers.

    BiancoBellucci

    (@biancobellucci)

    Thanks for sharing your efforts.
    I am having the same problem with SimpleModal.
    Did you manage to find solution in the meantime?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: SimpleModal Login] Invoke from JS’ is closed to new replies.