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

  • Home
  • SEARCH
  • 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 7700545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:44:01+00:00 2026-05-31T22:44:01+00:00

Hello people of stackoverflow. I have a problem. I’m trying to set up my

  • 0

Hello people of stackoverflow. I have a problem. I’m trying to set up my WordPress website so that when I hover over the main-nav elements an icon will fade in next to whatever the link is.

I got the fade in part working, but it appears that when I hover over, say, the “About Me” section, the link at the footer will also have the icon associated with it appear next to it.

I’m just wondering how I can exactly select just the nav elements within the top nav bar.

tl;dr

I need to make jquery just select a certain class within the main-nav id.

Here. Look at my code:

   <div id="nav">
        <div id="navstart"></div>
    <div id="navbar">
    <nav id="main-nav" class="horiz-list" role="navigation">
        <div class="menu">
<ul>
     <li class="page_item page-item-5"><a href="http://bjcasillas.com/about/"><img src="http://bjcasillas.com/wp-content/uploads/icons/icons_01.png" class="page_icon" alt="About">About</a></li>
     <li class="page_item page-item-8"><a href="http://bjcasillas.com/blog/"><img src="http://bjcasillas.com/wp-content/uploads/icons/icons_05.png" class="page_icon" alt="Blog">Blog</a></li>
     <li class="page_item page-item-6"><a href="http://bjcasillas.com/contact/"><img src="http://bjcasillas.com/wp-content/uploads/icons/icons_03.png" class="page_icon" alt="Contact">Contact</a></li>
     <li class="page_item page-item-10"><a href="http://bjcasillas.com/works/"><img src="http://bjcasillas.com/wp-content/uploads/icons/icons_07.png" class="page_icon" alt="Works">Works</a></li>
</ul>
          </div>
    </nav>
    </div>
    </div>

And then for the jquery at the moment:

//------Icon Fades------
$(".page_icon").hide().end();

$("#main-nav.page_item.page-item-5").hover(function () {
    $(".page-item-5 img").fadeIn(300);
  }, function () {
    $(".page_icon").fadeOut(300); }
);

$(".page_item.page-item-8").hover(function () {
    $(".page-item-8 img").fadeIn(300);
  }, function () {
    $(".page_icon").fadeOut(300); }
);

$(".page_item.page-item-6").hover(function () {
    $(".page-item-6 img").fadeIn(300);
  }, function () {
    $(".page_icon").fadeOut(300); }
);

$(".page_item.page-item-10").hover(function () {
    $(".page-item-10 img").fadeIn(300);
  }, function () {
    $(".page_icon").fadeOut(300); }
);

Thanks 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-05-31T22:44:02+00:00Added an answer on May 31, 2026 at 10:44 pm

    The short answer. jQuery has a selector ‘:first’ that will select the first occurrence of an item in the dom. So, this should only fade in the first icon:

    $(".page-item-6:first img").fadeIn();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello wonderful people of stackoverflow! I have a problem. I am working on an
Hello again Stackoverflow people! Assume I have these words: smartphones, smartphone I want to
Hello great people of stackoverflow.com, I have a stumbled upon a great difficulty in
Hello people from stackoverflow I have found more IE7 problems (tested in compatibility mode
Hello to all you people out there I have been trying to download the
Hello good Stack Overflow people, I do have a business problem and would like
Hello good people of stackoverflow, I am having a weird problem while following Adam
Hello fellow computer people :) I have a shell script that I will use
Hello people I have made a custom title bar for my app. I would
Hello I have 2 tables: Events (idEvent, eventName) and Registrations(idRegistration, idEvent, idPerson) People register

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.