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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:44:13+00:00 2026-05-28T19:44:13+00:00

$(function(){ $(.nav ul li).each(function(e){ $(this).mouseover(function(){ $(.subnav .left div:not(:eq(+e+))).hide(); $(.subnav .left div).eq(e).show(); }) }) })

  • 0
$(function(){
    $(".nav ul li").each(function(e){
        $(this).mouseover(function(){
            $(".subnav .left div:not(:eq("+e+"))").hide();
            $(".subnav .left div").eq(e).show();
        })
    })
})

what’s div:not(:eq("+e+"))")meaning in the above code? i don’t know why it use two + in the parenthesis? could i use div:not(:eq(e))") to instead of it? thank you.

  • 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-28T19:44:13+00:00Added an answer on May 28, 2026 at 7:44 pm

    In JavaScript, + is used to add two things together.

    In this case, it’s adding strings.

    This:

    ".subnav .left div:not(:eq("+e+"))"
    

    Means adding three strings to become one:

    1. .subnav .left div:not(:eq(
    2. e
    3. ))

    The final result is the value of e added to the jQuery selector, e being the index of the currently iterated element.

    The outcome of this whole thing in simple words is: when mouse is over specific list item, hide all <div> elements under .subnav .left except the <div> in same index as the hovered list item.

    Edit: You can avoid the messy code and dump the + by having such code instead:

    $(".subnav .left div").not(function(index) {
        return (index === e);
    }).hide();
    

    More lines, but also more elegant as you show the logic inside a function, not a string.

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

Sidebar

Related Questions

// accordion $(#left-nav .block h2).click(function(){ $(this).next(div).slideToggle(fast, function() { alert(hey); $(#left-nav, #content, #aside).equalHeight(); }) .siblings(div:visible).slideUp(fast);
<script type=text/javascript> //<!-- $(document).ready(function() { $('ul.course-nav li a').each(function() { alert(5); if ('#' == $(this).attr('href'))
Here is my code for a mouseover: $('.caption').mouseover(function() { $(this).fadeTo('slow',1); $(this).css('color','#ddd').animate({'color': 'white'}, 500); $(this).css('font-weight','bold');
I'm parsing a XML using jQuery with the following code: function appendNav(xml) { $(xml).find(Nav).each(function()
I'm using this currently: $(document).ready(function () { $('ul#nav > li').hover(function () { $('ul:first', this).show();
I'm using the current jQuery : $(function() { $('span .breadcrumb').each(function(){ $('#nav').addClass($(this).text()); $('#container').addClass($(this).text()); $('.stretch_footer').addClass($(this).text()) $('#footer').addClass($(this).text());
I've got this bit of JQUERY: <script> function initNav() { $('.nav tr table td
Here's my function to load my content: $(#site-nav .nav1).on('click', function () { $(this).addClass(nav-active); $('ul.top-level').load('assets/includes/recent.php',
Would anyone now why this script is disabling my nav in webkit browsers $(document).ready(function
Here is an except of javascript. function showContent(layer, animate) { $(#background).show(); $(footer).hide(); $(#announcement).hide(); $(#content).html($(#

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.