Reputation: 103697
Html looks like:
<div class="ticker">
<div class="news-heading">Latest News:</div>
<span class="active_ticker"><a href="#"> 1] Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></span>
<span><a href="#">2] Mauris semper mi eget libero venenatis mattis.</a></span>
<span><a href="#">3] Etiam sit amet enim ante, pulvinar porta sem.</a></span>
<span><a href="#">4] Fusce sit amet felis at felis posuere tristique id eu nisi.</a></span>
<span><a href="#">5] Integer et eros augue, at cursus turpis.</a></span>
<span><a href="#">6] Proin id diam dolor, vitae gravida est.</a></span>
</div>
var $tickeritem = jQuery(".ticker span");
$new_ticker_item = $tickeritem.filter(":eq(" + i + ")");
What is :eq(" + i+ ") doing?
Upvotes: -1
Views: 103
Reputation: 8560
This will set the $new___ticker_item variable to point to the DOM element which is the first span tag within the i-th DOM element with a class of "ticker"
Upvotes: 1
Reputation: 67892
It's filtering to the appropriate index, mapped to i.
http://docs.jquery.com/Selectors/eq#index
Upvotes: 1
Reputation: 1793
jQuery Documentation:
:eq(index) Returns: Array Matches a single element by its index.
Upvotes: 2