Jump to content

jquery event.target.hasclass() works in firefox, not in safari.


shortysbest

Recommended Posts

Well actually it's an odd problem, there is multiple problems with jquery in Safari, only on localhost though, when I put the files onto my webserver they work fine. I'm not sure what the issue could be for this, not a huge ordeal though as I use Firefox for my primary localhost browser to build with.

Actually that example above didn't work in safari, well not entirely, however I made a new working script that was better and does work in all major browsers.

 

share it! ::) to help others

$(document).click(function(event) {
////Hide Notifications

   if($(event.target).parents("div:first").attr("class")=="notifications-container"||$(event.target).parents("div:first").attr("class")=="quick-box"||$(event.target).attr("class")=="notifications")
   {}else
		{
			$(".notifications-container").hide();
		}

});

 

This is what I replaced it with which works good.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.