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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:04:15+00:00 2026-05-16T23:04:15+00:00

i am new to jQuery and i am having some rollover issues, i am

  • 0

i am new to jQuery and i am having some rollover issues, i am trying to apply the same “roll over” effect to multiple divs, and it seems to work, the only thing is when i roll over an element all of my divs get the same effect, when i would like them to apply the effect one at a time on mouse over, here is my code

  $('div.pitem').bind('mouseenter mouseleave', function() {
  $('div.p-tab').toggleClass('pheader-bar-selected');
  });
  $('div.pitem').bind('mouseenter mouseleave', function() {
  $('div.p-fline').toggleClass('pfooter-bar-selected');
  });

I do realize that i have the same classes on all of my divs but i was hoping to find a way to do this with out giving every single div a unique class or id, any help would be amazing 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-16T23:04:16+00:00Added an answer on May 16, 2026 at 11:04 pm

    What you are doing currently is on every hover you toggle the CSS class on all elements selected by div.p-tab, which will be any DIV with the CSS class p-tab.

    What you want to do is only toggle the CSS class on elements next to the hovered element in your HTML structure div.pitem.

    To find the currently hovered item, in your event use this keyword, and turn it into a jQuery object by using $(this). To find elements next to (adjacent) you will use the siblings function. You can also combine your two hover events.

    $('div.pitem').bind('mouseenter mouseleave', function() { 
        $(this).siblings('div.p-tab').toggleClass('pheader-bar-selected');
        $(this).siblings('div.p-fline').toggleClass('pfooter-bar-selected');
    }); 
    
    
    <div class="grid_3 portfolio-item">
        <div class="p-tab pheader-bar">
            <span class="tfm-drpa">&raquo;</span>
        </div>
        <div class="pitem">
            <a href="#"></a>
        </div>
        <h2 class="pcontent">Consectetuer Adipiscing Elit<span class="ptitlelines">///</span></h2>
        <div class="p-fline pfooter-bar"></div> 
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a bit new to programming in jQuery/Javascript and am having some issues
I'm having some issues with datepicker in jQuery. I'm trying to put the today
I'm very new to jQuery and having some issues figuring out stuff here :)
I am having some trouble setting up FancyBox, I am somewhat new to jQuery.
I'm very new to JQuery, and I'm having some trouble understanding how to do
I'm new to JQuery and I'm having some trouble with the Clone() function. My
I'm having some issues with some javascript/jquery and a database connection. Basically I am
I'm new to JQuery In my App, I have some 5 divs. While clicking
I'm trying to use the new autocomplete function in jQuery UI, but I'm having
I am having some issues with Microsoft Explorer 6/7 and the jQuery clone function.

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.