Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9147549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:00:59+00:00 2026-06-17T11:00:59+00:00

$(document).ready(function(){ if (!$(‘body’).hasClass(‘home’) || !$(‘ul#main-menu li.wwd’).hasClass(‘active’)){ $(ul#sub-menu).css(‘display’,’none’); $(.main-content).css(‘margin-top’,’13px’); $(ul#sub-menu).mouseover(function() { $(ul#sub-menu).show(); $(.main-content).css(‘margin-top’,’62px’); }).mouseout(function() {

  • 0
$(document).ready(function(){
if (!$('body').hasClass('home') || !$('ul#main-menu li.wwd').hasClass('active')){
$("ul#sub-menu").css('display','none');
$(".main-content").css('margin-top','13px');
$("ul#sub-menu").mouseover(function() {
        $("ul#sub-menu").show();
        $(".main-content").css('margin-top','62px');

}).mouseout(function() {
        $("ul#sub-menu").hide();
        $(".main-content").css('margin-top','13px');
});
$("li.wwd").mouseover(function() {
        $("ul#sub-menu").show();
        $(".main-content").css('margin-top','62px');
}).mouseout(function() {
        $("ul#sub-menu").hide();
        $(".main-content").css('margin-top','13px');
});
}
if ($('ul#main-menu li.wwd').is('.active')){
        $(".main-content").css('margin-top','62px');

}
})

I need to run this jQuery on all pages besides the home page(that works fine) but also not on pages where li.wwd has class active. I thought this would work with an OR operation but it does not. Thanks for any help in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:01:00+00:00Added an answer on June 17, 2026 at 11:01 am

    To evaluate the !(not) condition for both places you need to use && instead of ||, just like

    if (!$('body').hasClass('home') && !$('ul#main-menu li.wwd').hasClass('active'))
    {
        // code goes here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQuery(document).ready(function(){ /* for top navigation */ jQuery(#menu ul, #menu li).css(-webkit-transform, translateZ(0)); jQuery( #menu ul
$(document).ready(function() { $(span.link).mouseover(function(e){ $(this.children).css(display,inline); }); }); I'm not a javascript expert, but I've cobbled
jQuery(document).ready(function ($) { $('body').keypress(function (e) { alert(e.which); }); }); This will pop up an
$(document).ready(function() { //Default Action $(.tab_content).hide(); //Hide all content $(ul.tabs li:first).addClass(active).show(); //Activate first tab $(.tab_content:first).show();
$(document).ready(function(){ setInterval(swapImages(),1000); function swapImages(){ var active = $('.active'); var next = ($('.active').next().length > 0)
jQuery(document).ready(function($) { var devices = $(.menu-item-custom).map(function() { return this.id.substr(10); }).toArray(); $.each(devices, function() { $(#menu-item-settings-+this+
$(document).ready(function() { $('.cats_showall').click(function() { $('.cats_dropdown li').slideToggle(); }); }); .cats_dropdown li { display: none; }
$(document).ready(function() { $(#dvv).mousedown(function() { $(#dvv).mousemove(function(e) { $(#dvv).css({ 'margin-top': e.pageY - 15, 'margin-left': e.pageX -
$(document).ready(function () { $([data-role=content]).not(#ft).children().live({ mouseover: function () { $(this).css({ border: 1px solid gray });
$(document).ready(function() { $(tr).removeClass(); $(tr:gt(0)).click(function() { $(this).css(color, red) }); }); .highlight td { background: red;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.