[jQuery] Image change on link hover.
I have a crude demo working when I hover over a link an image above is
switched out.
How do I best store what image I want the link to swap to?
$(".showPic").hover(function() {
$("#imgLinkAct").attr("src", "images/valve_manifold.jpg");
});
The html:
<p class="centered" style="height: 80px;"><img id="imgLinkAct"
src="images/cylinder.jpg"/>
<p style="margin-left: 2%;">
<a href="linear_actuators.html">Linear Actuators</a><br/>
<a href="#" class="showPic">Guided Actuators</a><br/>
<a href="#">Grippers & Escapements</a><br/>
Would I store the img path in the <a> tags title attribute?
I would like to not hard code it in the jquery/script..