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 690687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:27:43+00:00 2026-05-14T02:27:43+00:00

I have a simple nav made up of the following HTML; <div class=inner> <div

  • 0

I have a simple nav made up of the following HTML;

<div class="inner">
<div class="button"><img class="portal" src="images/portalbutton.png" /></div>
<a href="#"><div class="prod_description">&nbsp;</div></a>
</div>

There are a number of items (All set to float left along side each other) to make up a nav bar.

When I hover over .button and/or .prod_description I want the .inner <div> to have the class .hover added to it. This is so I can set a background image around the whole thing (Kind of like highlighting the nav item).

I only then want to remove .hover when another .button or .prod_description is hovered over, in which case this nav item takes the .hover class.

  • 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-05-14T02:27:44+00:00Added an answer on May 14, 2026 at 2:27 am

    When I hover over .button and/or .prod_description I want the .inner <div> to have the class .hover added to it.

    Unless your CSS is positioning things in a very clever way, this would be the same as hovering the .inner itself, right? If so, the task can be solves as easy as:

    $('.inner').hover(function() {
        $('.inner').removeClass('hover');
        $(this).addClass('hover');
    });
    

    If my assumption about the positioning doesn’t hold, the code will have to look more like this:

    $('.inner .button, .inner .prod_description').hover(function() {
        $('.inner').removeClass('hover');
        $(this).parents('.inner').addClass('hover');
    });
    

    In the latter code sample, notice the use of parents() – not to be confused with parent().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple sidebar like this: <div class=sidebar> <ul class=nav> <li class=Page1><a href=Page1.html>Page1</a></li>
I have the following simple 3 level menu structure: <nav class=main-nav class=list> <ul> <li
I have a simple nav menu: <ul> <li><a href=index.php id=home_menu>Home</a></li> <li><a href=purchase.php class=selected id=information_menu>Information</a></li>
I have a simple nav bar like so: <ul class=nav> <li><a href=<%= index_url %>>Home</a></li>
I have simple class with width and height member fields which define number of
I have a simple horizontal UL LI main nav which I am trying to
I have simple element: <a id=a1 href=# style=position:absolute; top:0; left:0; nav-index:1; nav-down:#b1; nav-right:#a3; nav-left:#a1;
I have a simple grouped uitableview with a nav bar and an Edit nav
I have a simple nav menu with submenus. When the links in the submenu
I have a simple app with a nav bar controller and I would like

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.