jquery code I am unable to understand -
the following piece of code https://github.com/tsi/inlinedisqussions/blob/master/inlinedisqussions.js
what piece of code doing please? i'd appreciate plain english translation. student here.
// hide discussion. $('html').click(function(event) { if($(event.target).parents('#disqussions_wrapper, .main-disqussion-link-wrp').length === 0) { hidedisqussion(); } });
what code register mouse button click event on whole of page. if clicks on page, function called. function passed event (which click event). within event there property called "target" html element clicked. ask if clicked element has parent ancestor element either element "id" of "disqussion_wrapper" or has class of "main-disquission-link-wrp". if neither of these true, call function called hidedisqussion().
Comments
Post a Comment