JQuery Selecting specific li element
Ok I have been struggling with this for a little bit. I'm still learning
JQuery.
Here is what I have:
The Script:
$('ul li.error').animate({
height: 'toggle',
opacity: 'toggle'
}, {
duration: 500,
specialEasing: {
width: 'linear',
height: 'easeInOutCubic'
},
complete: function() {
$(this).each(function(){
$(this).delay(4000);
$(this).animate({
height: 'toggle',
opacity: 'toggle'
}, {
duration: 7000,
specialEasing: {
width: 'linear',
height: 'easeInOutCubic'
},
complete: function(){
$(this).delay(1000);
$(this).parent().next().find('li
input').css('border-color', 'red');
$('#somediv').slideDown();
}
});
});
}
});
The Html:
<div>
<ul>
<li class="error">(Error Message if any)</li>
<li class="label"><label></li>
<li class="input"><input></li>
<li class="error">(Error Message if any)</li>
<li class="label"><label></li>
<li class="input"><input></li>
</ul>
</div>
What I'm trying to do is select the li element that has the input and
change the border color. But I only want to change the border color of the
one where there was an error message.
How can I do this? Any help would be appreciated, Thanks!
No comments:
Post a Comment