javascript - Only FadeOut a Jquery Item IF the user is not clicking within it and using it -



javascript - Only FadeOut a Jquery Item IF the user is not clicking within it and using it -

i have pop-up box triggered via jquery appears in upper right give user info have done on site. currently, there x can click close it, fades away after while via script:

settimeout(function(){ $('#ratingtext-'+imgid+itemtype+type2+'').fadeout() }, 2500);

the box , right , meant inconspicuous why utilize fadeout.

however, adding in comments box, after rate item, can leave comment well.

is there way can craft above script if clicking on or in div or using it, div won't fadeout, if leave alone, still fade out?

settimeout(function() { if (!$(".comment_being_focused").is(":focus")) { $('#ratingtext-' + imgid + itemtype + type2 + '').fadeout(); } }, 2500);

http://api.jquery.com/focus-selector/

javascript jquery

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -