[jQuery] Is there a more efficent way to write this script?
Hi there I am new to jquery tonight and I have already build the below
script and everything seems to be working however I suspect there is a
better way to write this out?
like for instance here
$(this).children("h3").children("a").css("text-decoration",
"underline");$(this).children("a").css("text-decoration",
"underline");
I am changing the css text decoration on A tags within H3 elements and
also on child A tags is there not a way to bundle these together? so I
would only have to write out the .css("text-decoration", "underline");
part once?
Please advise
Here is my full script it uses the 1.3.1 jquery and the color plugin
$(".JQorangeHighlight").hover(
function() {$(this).children("h3").children("a").css("text-
decoration", "underline");$(this).children("a").css("text-decoration",
"underline");$(this).animate({ backgroundColor: "orange" }, 500); $
(this).children("p").animate({ color: "white" }, 400) },
function() {$(this).children("h3").children("a").css("text-
decoration", "none");$(this).children("a").css("text-decoration",
"none");$(this).animate({ backgroundColor: "eggshell" }, 500); $
(this).children("p").animate({ color: "grey" }, 500)
});