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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:51:45+00:00 2026-06-06T17:51:45+00:00

question 1: i am trying to manipulate same classed div element’s css to their

  • 0

question 1:
i am trying to manipulate same classed div element’s css to their order with eq() but i cant access the eq() value.

question 2:
tried this with switch method. is there a way to do this progress with lesser code like for loop?

this is DEMO

HTML

<div id="a" class="ele">0</div>
<div id="b" class="ele">1</div>
<div id="c" class="ele">2</div>

​
jQuery

$('.ele').each(function() {
var eleH = 100;
var add = 10;

 $('.ele').eq(X); //trying to get value here

 switch(X) {
  case 0:
    $('.ele').css({'height': (eleH + add) + 'px'}); // #a { height:110px}
    break;
  case 1:
    $('.ele').css({'height': (eleH + (add*2)) + 'px'}); // #b { height:120px}
    break;
  case 2:
    $('.ele').css({'height': (eleH + (add*3)) + 'px'}); // #c { height:130px}
    break;
 }

});
  • 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-06T17:51:47+00:00Added an answer on June 6, 2026 at 5:51 pm

    I’m not sure what do you want to do, but if you want to change CSS propierty according its position you can do it like this:

    $('.ele').each(function(i) {
        $(this).css('height', 100 + (10*i));
    });
    

    Here is the working version: http://jsfiddle.net/Aw39W/6/

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

Sidebar

Related Questions

Question: I am trying to fire a .click() event if a <ul></ul> element has
I found the exact same question here . But it isn't working for me.
New to Python, have a simple, situational question: Trying to use BeautifulSoup to parse
Question: I'm trying out to convert this here: http://support.microsoft.com/kb/828736 to VB.net I got it
Question I'm trying to create a basic wxWidgets program with a text entry box,
Question I am trying to use a button to delete the first entry to
Short question: I'm trying to make that in a given page (uses tabs) back
Maybe dumb question: I'm trying to realize a little server in Java with com.sun.net.httpserver
hello i have this question i was trying to find a way to call
This is a question based on: Trying to get tag-it to work with an

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.