...

View Full Version : animate with parent. children



Phil Jackson
09-24-2009, 06: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");

seco
09-24-2009, 07:07 AM
are you getting an error at all?

Phil Jackson
09-24-2009, 07:10 AM
nope just not working

Phil Jackson
09-24-2009, 07: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, 07:13 AM
idiot.

.each(function(){

seco
09-24-2009, 07:14 AM
haha always somthin huh

Phil Jackson
09-24-2009, 07: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");
}
});
});
});



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum