javascript - Jquery must be stopped from closing when inside div is clicked -


http://jsfiddle.net/pfwzg/3/

i have password enter box pops up, , when click anywhere on page, fades out. fades out when try enter password too. kindly appreciated.

$(document).ready(function () {     $('.chatmic').click(function () {         $(".chatmic").toggleclass("chatmicoff");     });     $('.chatloudspeaker').click(function () {         $(".chatloudspeaker").toggleclass("chatloudspeakeroff");     });     $('.adminbox').click(function () {         $(".passwordcontainer").toggle();         $(".textbox3").focus();     });      $('.adminbox').click(function () { return false; });     $('.adminbox').click(function () {         $('.passwordcontainer').fadein('fast', function () {         $(".textbox3").focus();             $(document).one('click', function (e) {                 $('.passwordcontainer').fadeout('fast');             });         });     }); }); 

try below code: here working fiddle

 $(document).ready(function () {             $('.chatmic').click(function () {                 $(".chatmic").toggleclass("chatmicoff");             });             $('.chatloudspeaker').click(function () {                 $(".chatloudspeaker").toggleclass("chatloudspeakeroff");             });             $('.adminbox').click(function () {                 $(".passwordcontainer").toggle();                 $(".textbox3").focus();             });              $('.adminbox').click(function () { return false; });             $('.adminbox').click(function () {                 $('.passwordcontainer').fadein('fast', function () {                 $(".textbox3").focus();                  });             });               $('.passwordcontainer').click(function () {                  return false;              });  $(document).bind('click', function (e) {                         $('.passwordcontainer').fadeout('');                     });         }); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -