I have a CSS class:
.something{
//all my css stuff here
}
I have 10 different elements that use this class:
<div class='something'></div>
<div class='something'></div>
<div class='something'></div>
<div class='something'></div>
<div class='something'></div> //ect ect....
Each of those divs need to be positioned differently and I don’t want to make like 10 copy’s of .something and point each one at a different class because its only the position that needs to change.
Also, I’m using JQuery to animate these divs, like:
$('.something').animate();
But that will animate all the divs attached to that class right? Is there any way around that?
You can specify an ID as well. So, you can do something like this:
Then:
And still apply styles like:
Or, alternatively, you can not use IDs and simply loop: edited for simplicity
If you’ll be animating each
divin somewhat the same way.