Omitting Drupal's admin overlay from selectors

I had an issue recently, where I was using a selector to add menu tabs to the edge of the content area. Getting them to appear wasn't the issue. Getting them NOT to appear on admin overlays was.
The body class on which my selector was based didn't change when an admin overlay covered the page. It was still .front. So, how to do the equivalent of the following pseudo-code?
if body class = front but not an admin overlay?
What DOES change in the markup is the html tag. It has the class
when the admin overlay is present. So, given that, how do we select the body from
  <body class="front">
but not
<html class="overlay-open">
  <body class="front">
'not' is the answer. Or, more precisely, '.not'. There are, of course, many ways to finagle the desired selection in jQuery. In this case, we can use .not to tell jQuery what we don't want along with what we do.
will return the body, unless the admin overlay is present, in which case it will return nothing.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Of course, the Drupal Community isn't the only place to give back. It's a complex world, and there are as many worthy causes as their are melodies, with most being served by multiple charitable organizations. Here are a few of those that strike a 7th chord with me.