简体   繁体   中英

Unhide login popup while clicking outside of Div

I'm using the bellow script to get login dialogue box when the user click's anywhere inside the homepage.

<?php
 if (Mage::getSingleton('customer/session')->isLoggedIn())
 { 
    echo '<body>';
 } else {
    echo '<body onClick="showSmartRegisterDialog(); return false;">';
 }
?>

If i click anywhere outside the login form div, the login window is appearing again. How to solve this?

Did anyone came through this problem ?

Solution to solve this highly appreciate-able....

Clear the onclick after showing the dialog. ;)

echo '<body onclick="showSmartRegisterDialog(); this.onclick = \'\'; return false;">';

edit:

Try changing this:

Event.observe($$('#smartlogin .overlay-modal')[0], 'click', function(event){
    $$('#smartlogin .error')[0].style.display != 'none' ? smartLogin.closeError() : smartLogin.hideSmartDialogs();
});

to this:

Event.observe($$('#smartlogin .overlay-modal')[0], 'click', function(event){
    if($$('#smartlogin .error')[0].style.display != 'none') smartLogin.closeError();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM