I\'m new to jQuery and javascript in general but am plugging my way through thanks to sites like these.
I have a page with six hidden divs that are called with correspon
You could do something like
function fadeElementIn(fadedElement) {
$("[id^=panel]").fadeOut("slow");
$(fadedElement).fadeIn("slow");
}
And then:
$(document).ready(function(){
$("#link1").click(fadeElementIn($("#panel1")));
$("#link2").click(fadeElementIn($("#panel2")));
$("#link3").click(fadeElementIn($("#panel3")));
$("#link4").click(fadeElementIn($("#panel4")));
}
remember to adjust your elements positioning if you want the one that's fading out and the one that's fading in to occupy the same space
cheers