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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:52:46+00:00 2026-06-03T11:52:46+00:00

I have code to create a single Google+ circle. But when I created multiple

  • 0

I have code to create a single Google+ circle. But when I created multiple circles using a for loop in JSTL (JSP) (ArrayList), all circles hover at once. I need circle effect on each circle when I place the mouse on it. I’m using jQuery for the effects. The following is the code:

JSP
ArrayList

  <c:forEach items="${groups}" var="groups">
          <div id="circle">
        <div class="outer"> </div>
        <div class="middle"></div>`enter code here`
        <div class="inner"><c:out value="${groups.name}"/></div>
    </div>

 </c:forEach>

for different id <c:out value="${groups.id}"/>

jQuery

$(function() {

    $('#circle').mouseover(function() {

        $('div.outer').addClass('hover');
        $('div.middle').addClass('hover');
    });


    $('#circle').mouseout(function() {
        $('div.outer').removeClass('hover');
        $('div.middle').removeClass('hover');
    });

});

Please help me out in creating multiple circles.

  • 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-03T11:52:48+00:00Added an answer on June 3, 2026 at 11:52 am

    First, you’re using a unique id attribute to identify more than one circle. This is incorrect. When using id attributes, each id must be unique. Use a class instead when grouping similar elements.

    With that said, after careful review, this is not actually causing your specific problem here; however, if not corrected, it could manifest as a different problem later on in the future.

    Actually, the problem is caused by your addClass and removeClass selectors.

    When you add and remove the hover classes, you are doing this on all of the DIV’s with class outer and class inner. Use the jQuery find method to target only the specific DIV’s in the context of your circle:

    $(function() {
    
        $('.circle').mouseover(function() {
    
            $(this).find('div.outer').addClass('hover');
            $(this).find('div.middle').addClass('hover');
        });
    
    
        $('.circle').mouseout(function() {
            $(this).find('div.outer').removeClass('hover');
            $(this).find('div.middle').removeClass('hover');
        });
    
    });
    

    I also changed your selector to use a class.

    <c:forEach items="${groups}" var="groups">
          <div class="circle">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So Im using a single google analytics code for multiple domains. But now the
Right now I have google map code that will set a single marker on
I have code to create another row (div with inputs) on a button click.
I have a code: CREATE TABLE IF NOT EXISTS Person ( name varchar(24) ...
I have this code to create an ATOM feed Dim xmlResult As New StringBuilder
I have some code to create a basic dialog box with several options -
I have this code to create a webapp in my server: import web urls
I have the following code to create an HttpWebRequest in my WP7 application. I'm
I have the following code to create a UIPickerView: pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0f,
I have used following code to create a simple PDF file. It executes fine

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.