Put the alternate image in a rel attribute on the actual images:

<img src="theOFFimage.jpg" rel="theONimage.jpg">

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Danjojo
Sent: Wednesday, July 18, 2007 2:23 PM
To: jQuery (English)
Subject: [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>
<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 &amp;
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..


Reply via email to