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

javascript - I need to update the text of a paragraph by inline edit -

javascript - THREE.js reposition vertices for RingGeometry -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -