Have you ever had to manually code something that is sequential? Didn't you find it annonying? Well, here is a simple solution for you. This tutorial will show you how to use jQuery to add a sequent of CSS classes to create a graphical list. The second example will show you how to add a comment counter to a comment list using jQuery's prepend feature.
1a. Insert jQuery Code
First, download a copy of jQuery. In between the <head> tag, insert the jQuery code:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#step li").each(function (i) {
i = i+1;
$(this).addClass("item" i);
});
});
</script>
The jQuery will output the source code as:

1b. CSS Code
Style the <li> element with a background image accordingly (step1.png, step2.png, step3.png, and so on..).
#step .item1 {
background: url(step1.png) no-repeat;
}
#step .item2 {
background: url(step2.png) no-repeat;
}
#step .item3 {
background: url(step3.png) no-repeat;
}
2a. Add Sequential Content
You can also use this technique to add sequential content using jQuery's prepend feature. The following example shows how you can add a counter number to a comment list.
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#commentlist li").each(function (i) {
i = i+1;
$(this).prepend('<span class="commentnumber"> #' i '</span>');
});
});
</script>
The code will add the <span class="commentnumber"> tag (with # + 1) to each <li> tag.

2b. CSS
Style the <li> element with position:relative and use position:absolute to place the .commentnumber to the top right corner.
#commentlist li {
position: relative;
}
#commentlist .commentnumber {
position: absolute;
right: 0;
top: 8px;
}


There is missing a “+” in your javascript in this line:
$(this).addClass(“item” i);
Elsewise it’s great! :)
Apple’s launch of the iPhone 4 white has seen the greatest excitement for a new phone ever, with HD video recording, a super high-res screen and ridiculously slim dimensions, it’s not hard to see why its so popular in the world.
As iphone 4 white 3GS has something of non-update to the iPhone range, but there are finally decent alternatives in the smartphone market, with the HTC Desire and Samsung Galaxy S leading the Android fight right to Apple’s door.
Very Nice.. I love it.
i need to know the complete list of all possible jquery operations.
IE, the only browser that wastes designers time.
I hope microsoft changes the way it behaves now in the near future.If not no one would use it.
yanar sözlerim
ağlattın bir günde güldür beni sennnn
This information is really good and I will say will always be helpful if we try it risk free. So if you can back it up. That will really help us all. And this might bring some good repute to you.
i need to know the complete list of all possible jquery operations.
I like this
I always follow your site thank you
i need to know the complete list of all possible jquery operations.
Yep, definitely is annonying to manually code something that is sequential. You really are a big help. Thanks.
I would have been doing a senseless sequential. Thank you for creating this article.
I always follow your site thank you
Thanks for the info. Bookmarked
thanks to information
Very detailed. Easy to follow.
I really enjoy this theme youve got going on on your internet site. What is the name of the theme by the way? I was thinking of using this style for the web site I am going to construct for my class project.