{"id":2285,"date":"2012-11-02T17:58:06","date_gmt":"2012-11-02T17:58:06","guid":{"rendered":"http:\/\/blog.ed.gs\/?p=2285"},"modified":"2012-11-02T17:58:06","modified_gmt":"2012-11-02T17:58:06","slug":"jquery-multiple-not-selectors","status":"publish","type":"post","link":"https:\/\/ed.gs\/2012\/11\/02\/jquery-multiple-not-selectors\/","title":{"rendered":"jQuery Multiple :not Selectors"},"content":{"rendered":"
I use jQuery on this site to fade in and out on link clicks, although there are some exceptions that I have to disable it for. It’s easy enough to do it for one selector, but if you need to add multiple selectors you need to append the :not after the last as follows.<\/p>\n
jQuery('a:not([href^=mailto]):not(".bsub")').click(function() {\n var location = jQuery(this).attr('href');\n jQuery('#content').animate({\n opacity: 0\n }, 250);\n jQuery('.bounce').animate({\n left: -500\n }, 300, function() {\n document.location = location;\n });\n return false;\n});<\/pre>\n","protected":false},"excerpt":{"rendered":"I use jQuery on this site to fade in and out on link clicks, although there are some exceptions that I have to disable it for. It’s easy enough to do it for one selector, but if you need to add multiple selectors you need to append the :not after the last as follows. jQuery('a:not([href^=mailto]):not(".bsub")').click(function() […]<\/p>\n","protected":false},"author":2,"featured_media":3521,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false},"categories":[37,38],"tags":[],"yoast_head":"\n
jQuery Multiple :not Selectors - E<\/title>\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\n\n\t\n