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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:07:44+00:00 2026-06-18T00:07:44+00:00

I want to hover 3 item at a time. when i will put cursor

  • 0

I want to hover 3 item at a time. when i will put cursor one of them. It should hover other two item.
please can help me anyone. i want to do this with javascript. I have make a model but it is not good. i want to use with function so i can use this again and again. please help me.

<!DOCTYPE html>
<html>
<head>

  <script type="text/javascript" src="jquery.js"></script>

<style type="text/css">
.boxes {
    float: left;
    display: inline;
    width:150px;
    height:100px
}
.box1 {
    width:50px;
    padding:10px;
    border:1px solid gray;
    margin:0px;
    height: 20px;
}

.box4 {
    display: inline-block;
    width:150px;
    padding:10px;
    border:1px solid gray;
    height: 100px;
}


</style>
<script>
$(document).ready(function(){
    // box 1
    $('.box1').mouseover(function(){
        $('.box1').css('background-color', '#F7FE2E');
        $('.box4').css('background-color', '#F7FE2E');
        $('.hov').css('color', '#0f0');

    });
    $('.box1').mouseout(function(){
        $('.box1').css('background-color', '#FFF');
        $('.box4').css('background-color', '#FFF');
        $('.hov').css('color', '#fff');

    });
       $('.box4').mouseover(function(){
        $('.box4').css('background-color', '#F7FE2E');
        $('.box1').css('background-color', '#F7FE2E');
        $('.hov').css('color', '#0f0');

    });
    $('.box4').mouseout(function(){
        $('.box4').css('background-color', '#FFF');
        $('.box1').css('background-color', '#FFF');
        $('.hov').css('color', '#fff');

    });

});

</script>
</head>

<div class="boxes">
    <div class="box1">Box 1</div>

</div>
<div class="box4"><a href="#" class="hov">box4</a> </div>
<br/>
<div class="boxes">
    <div class="box1">Box 1</div>

</div>
<div class="box4"><a href="#" class="hov">box4</a> </div>

</body>
</html>
  • 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-18T00:07:45+00:00Added an answer on June 18, 2026 at 12:07 am

    If you group your divs by parent divs, you can use the HTML structure to determine what to highlight. I don’t know your exact usage model, but something like this:

    <div class="boxgroup">
        <div class="box1 hover"></div>
        <div class="box2 hover"><a href="mylink" class="hov">Link</a></div>
    </div>
    
    <div class="boxgroup">
        <div class="box1 hover"></div>
        <div class="box2 hover"><a href="mylink" class="hov">Link</a></div>
    </div>
    

    And then in your jQuery:

    $(document).on('mouseover', '.hover', function () {
        var boxgroup = $(this).closest('.boxgroup');
        boxgroup.find('.hover').addClass('hovercolor');
        boxgroup.find('.hov').css('color', '#0f0');
    }).on('mouseout', '.hover', function () {
        var boxgroup = $(this).closest('.boxgroup');
        boxgroup.find('.hover').removeClass('hovercolor');
        boxgroup.find('.hov').css('color', '#000');
    });
    

    Here, I use .closest() to find what group the div is in, and then highlight all of the other .hover items in that group.

    Example:

    http://jsfiddle.net/jtbowden/HZtVP/3/

    If you want your divs to not be physically grouped, there are other ways to do what you want.

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

Sidebar

Related Questions

On hover I want my div to scroll down. I know i can use
I want to create popover menu when certain menu item is hover-ed, my menu
I want to add a class to a list item when I hover over
whenever i hover over the currently selected menu item its color changes i want
I want to do the kind of menu, where when you hover the item,
Can I set if-else condition with hover function? I want to load a page
I want to hover over a table element, and display a popup box in
I am trying to emulate the menu's in http://www.clydeproperty.com/ I want to hover over
I'm developing a firefox extension and i want to simulate :hover state of an
I have a bunch of images lined up that I want to on hover

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.