DOM: eq()
div set 2 : 1
div set 2 : 2
div set 2 : 3
- list item set 1 # 1
- list item set 1 # 2
- list item set 1 # 3
- list item set 1 # 4
- list item set 2 # 1
- list item set 2 # 2
- list item set 2 # 3
- list item set 2 # 4
href set 1 # 2 ( href_class_1 )
href set 1 # 3 ( href_class_1 )
href set 2 # 1 ( href_class_2 )
href set 2 # 2 ( href_class_2 )
href set 2 # 3 ( href_class_2 )
- sibling1
- sibling2
- sibling3
- sibling4
function regEvents() {
$('a.eq')
.click( function () {
var eqIndex = $(this).id.split('_')[1];
$( $('#nodetypes').val() )
.eq( eqIndex )
.highlight();
});
}
$.ready(function () {
$('#nodetypes')
.change( function () {
if ( $('.eq').length > 1 )
$('.eq').remove();
for( var i=0, ilen = $($(this).val()).length; i<ilen;i++ ) {
var aId = 'aid_' + i, aText = 'eq('+ (i+1) +')';
$('.demoTitle').append('<a href="javascript:;" id='+aId+' class="finer eq">'+ aText +'</a>');
}
regEvents();
});
});