?
Solved

onclick animation...

Posted on 1997-12-11
3
Medium Priority
?
939 Views
Last Modified: 2013-11-19
I know how to use rollover javascripts to make a (hyperlinked) image change state before being clicked on (onmouseover/onmouseout), but is there a way of changing state for a non-hyperlinked image? Specifically, I want a static image which animates when clicked on. The animation can be handled by using an animated GIF, I just need someone to give me the right script (some variation of onClick I would imagine, but I don't really know enough about it...).

Cheers.
Ian Westbrook
0
Comment
Question by:westbrook
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
jshamlin earned 200 total points
ID: 1276088
There's presently no method to detect an onMouseover event for a "regular" image - you can create a "fake" link to manipulate it, though:

<A HREF="javascript:doThis()"><IMG SRC="thing.gif"></A>

Note that the function doThis() will be executed onClick - if you'd like the click to do nothing, then create an "empty" function for doThis().  You may also add event handlers to the HREF to manipulate the image onMouseover, etc.
0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1276089
If my comment works better for you, I would like the opportunity to post this as an answer.
0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1276090
I'm sure jshamlin's answer works, but at my level of knowledge 'empty functions' means nothing... techbuilder's answer is both more elegant and works, so at the risk of offending jshamlin, I think I'd rather his answer was posted.
But thank you both for your time!

Best regards,

Ian Westbrook
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question