html js click on blank space to close custom popup layer

Usually to make a custom drop-down box, the expanded div needs to be closed after clicking any blank area $(document).on('click',function(e){     var _con = $('.ztree,.js_ztree'); // Set the target area (check elements that do not need to be closed when clicking)     if(!_con.is(e.target)&&_con.has(e.target).length === 0){         $('.ztree').hide()     } })

The post html js closing custom popup layer on click on whitespace first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9092
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment