Moving a div down if a zone is present using jQuery I'm trying to move a &lt;div&gt; down if a zone is present, but I'm having a little trouble targeting the right classes, etc.

// See http://jsfiddle.net/xgbzm/.
(function ($) {

  if (!$(this).hasClass('responsive-layout-normal')) {
    if ($('.page .section-header .zone-ticker-wrapper', this).length &lt; 0) {
      $('.qtip .qtip-wrapper', this).css('margin-top', '65px');
    }
  }

})(jQuery);


How can I achieve it?
At a guess I'd say your problem is context...$(this) won't be defined in your current code.

First thing to do is make sure the code runs on document ready so the elements you're targeting actually exist:

(function ($) {
  $(function() {
    // ...
  });
})(jQuery);


Next you need to handle $(this). In your current context you would need to check the &lt;body&gt; tag for that class, e.g.

if (!$('body').hasClass('responsive-layout-normal')) {
  // ...
}


And finally, since you're using a responsive theme you probably want that code to be responsive, and run when Omega changes its media query. Note that now, since you're binding to the &lt;body&gt; tag, and have proper context, $(this) will refer to the element you're expecting:

(function($) {
  $(function() {
    $('body').bind('responsivelayout', function(e, d) {
      if (!$(this).hasClass('responsive-layout-normal')) {
        // Make changes
      }
      else {
        // Undo changes
      }
    });
  });
})(jQuery);