View Full Version : animate with parent. children
Phil Jackson
09-24-2009, 07:58 AM
Hi i have this:
$("#fname").parents("ul:eq(0)").children("li[class=description]").animate({fontSize: "16px"}, 1000);
Anyone know why it wont work yet this will??
$("#fname").parents("ul:eq(0)").children("li[class=description]").css("color", "red");
are you getting an error at all?
Phil Jackson
09-24-2009, 08:10 AM
nope just not working
Phil Jackson
09-24-2009, 08:11 AM
$("#formSignup ul li p input.userInput").each({
if ( $(this).val() == "" ){
$(this).parents("ul:eq(0)").children("li[class=description]").css("color", "red");
} else {
$(this).parents("ul:eq(0)").children("li[class=description]").css("color", "black");
}
});
This also is making my head scratch
Phil Jackson
09-24-2009, 08:13 AM
idiot.
.each(function(){
Phil Jackson
09-24-2009, 08:18 AM
sussed it, should have posted the html:
$("#submitForm").bind("click", function(){
$("#formSignup ul li p input.userInput").each(function(){
if ( $(this).val() == "" ){
$(this).parents("ul:eq(0)").children("li[class=description]").children("p").children("small").animate({fontSize: "11px"}, 1000).css("color", "red");
} else {
$(this).parents("ul:eq(0)").children("li[class=description]").children("p").children("small").animate({fontSize: "10px"}, 1000).css("color", "black");
}
});
});
});
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.