Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the feedzy-rss-feeds domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /data01/virt126885/domeenid/www.saksadogi.com/codegurus.eu/wp-includes/functions.php on line 6121
Do something when user click somewhere outside of wrapper - CodeGurus

Do something when user click somewhere outside of wrapper

To close or do something when users clicks outside of some element following few lines of code can be helpful.

$(document).click(function(event) {
	if ($(event.target).parents().index($('#first_wrapper')) == -1 &&
		$(event.target).parents().index($('.second_wrapper')) == -1) {
		// Run something
	}
});

Posted

in

,

by

Comments

Leave a Reply