echo"<td bgcolor='#FFFFFF'><a href=\"update.php?emailid=".$rows['emailid']."\"><img src='library/edit1.gif' border='0'></td></tr>";

I want to change the image 'edit1.gif' to 'edit1-o.gif' onmouseover and back to edit1.gif onmouseout event.how to do this while staying in these php quotes?
TIA

Recommended Answers

All 2 Replies

Rollover images are images that change when the mouse is over them.
Try this code

<A 
    HREF="rollover_target.html"
    onMouseOver = "rollover('home')" 
    onMouseOut  = "rollout('home')" 
    ><IMG 
    SRC="../graphics/home_out.gif" 
    NAME="home" 
    ALT="Home Page" BORDER=0 
    HEIGHT=130 WIDTH=115
    ></A>
<SCRIPT TYPE="text/javascript">
<!--
setrollover("../graphics/home_over.gif");
//-->
</SCRIPT>

Why not CSS 'hover' ? a:hover { background: url('yourimage.jpg'); } You should not use javascript ( onmouseover ) and ( onmouseout ) event for this simply matter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.