Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question.

Status
Not open for further replies.

beont

Programmer
May 16, 2008
9
I have used :

<td align="center" width = "20%" height = "40"
onmousedown ="this.style.backgroundImage ='url(./images/bc.jpg)'" onmouseover="this.style.backgroundImage ='url(./images/bo.jpg)'" onmouseout="this.style.backgroundImage='url(./images/b.jpg)'" background="./images/b2.jpg">
<A HREF='./index.php?nav=search' style='text-decoration:none'><font face="Tahoma" color=white size = 3>Search</font></a></td>

When mouseover it changes but when I try mousedown for the first time no image is displayed i have to click several times until the mousedown image appears. then everything works
 
Try to call a script method in the onmousedown event and in that method include the url(....).

See whether the onmousedown event is calling the method specified in the onmousedown event.
 
I would recoment onclick as well, unlike onmousedown onclick supports both mouse and keyboard methods of selection so you get the same effect for both methods.
 
Have you tried switching the images between mouseover and mousedown: maybe the image b.jpg is not loading well?

Otherwise, I would suggest you change the script to css class-based approach so that the event handling would be appearing:
[tt] this.className="class_for_mouseSomething"[/tt]
or if more than one class is assgined to the tag, replacing "class_for_mouseSomething" initially to some destined class. That should be somehow acting like reloading the images? But you should experiment it somehow to draw some lesson from it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top