{"id":340,"date":"2012-02-24T10:59:35","date_gmt":"2012-02-24T15:59:35","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=340"},"modified":"2024-12-05T11:46:28","modified_gmt":"2024-12-05T16:46:28","slug":"using-not-in-jquery-to-exclude-a-member-of-a-class","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2012\/02\/using-not-in-jquery-to-exclude-a-member-of-a-class\/","title":{"rendered":"Using not() in jQuery to exclude a member of a class"},"content":{"rendered":"<p>This is just a quick tip I thought I throw out there. We have an application that applies a fade to a .alert class on all its pages. We have 2 pages that need to not fade one particular alert. Here is one way it can be handled.<\/p>\n<ol>\n<li>Add a class of .notfade to the alert that needs to stay put and not fade out:<br \/>\n<code>&lt;div class=\"alert alert-info nofade\"&gt;&lt;\/div&gt;<\/code><\/li>\n<li>Place the following in $().ready(): <code>$(\".alert\").not(\".notfade\")fadeOut(7000);<\/code><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This is just a quick tip I thought I throw out there. We have an application that applies a fade to a .alert class on all its pages. We have 2 pages that need to not fade one particular alert. Here is one way it can be handled. Add a class of .notfade to the &#8230; <a title=\"Using not() in jQuery to exclude a member of a class\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2012\/02\/using-not-in-jquery-to-exclude-a-member-of-a-class\/\" aria-label=\"Read more about Using not() in jQuery to exclude a member of a class\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[26,28],"class_list":["post-340","post","type-post","status-publish","format-standard","hentry","category-developer","tag-javascript","tag-jquery"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-5u","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}