View Single Post
Old 10-02-2012, 07:37 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
1. I think your append string is badly formed - shouldn't it be like this?
Code:
$('#scrubberList').append('<li><span id="' + pages_arr[i] + '" index="' + i + '" class="scrubberBtn"></span></li>');
2. I think you are better off using the native jQuery attr
Code:
alert($("#scrubberList").attr("index"));
3. The scrubberList has no index, it is the li's that you append to it. Have a look at DOM transversal methods like nextAll() and children()
xelawho is offline   Reply With Quote