canuckconsulting
asked on
Need to animate buttons on webpage
I have a web page with buttons as shown here:
They work fine but there is no visual indication when the get clicked. What is the best and quickest way for me to visually respond to a click? Here is one of the buttons files as an example:
For image tools I have Gimp though I am a novice with it. I also have the Jquery and jqueryUI libraries working on this page if that's of any use.
They work fine but there is no visual indication when the get clicked. What is the best and quickest way for me to visually respond to a click? Here is one of the buttons files as an example:
For image tools I have Gimp though I am a novice with it. I also have the Jquery and jqueryUI libraries working on this page if that's of any use.
you'll probably want to use a unique ID instead of a class as you'll need various css for the different pictures. Forgot to do that. Just define css for each unique ID and you can change the code accordingly.
Or to make your life easier you can change the color of the class's css and just modify the way the image looks when they click on it. Like so:
You won't have to mess around with all those ID's in your CSS if you do it this way...
Or to make your life easier you can change the color of the class's css and just modify the way the image looks when they click on it. Like so:
.photo:focus{
filter: saturate(500%);
-webkit-filter: saturate(500%);
-moz-filter: saturate(500%);
-o-filter: saturate(500%);
-ms-filter: saturate(500%);
}
You won't have to mess around with all those ID's in your CSS if you do it this way...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Nick!
Interestingly that doesn't work for IE but looks good in Chrome.
Interestingly that doesn't work for IE but looks good in Chrome.
Hmm. I'm pretty new to jQuery, but I am pretty sure jQuery works very hard to be cross-browser compatible so the problem is probably elsewhere. My guess is that IE doesn't allow you to set a tab index for elements like a img tag.
Solution, just fake IE out by using links... Check out the solution for IE here
and remember you should be able modify the saturation (or other aspects) with the CSS i already gave you in an earlier comment so you don't have to specify unique images for each button and button focus.
Oh just found out CSS filter support is not in IE... So forget that idea...
Just give your images a class and a tabindex:
Open in new window
Then use css to define a new image for your image when it has the focus (i.e. is clicked on).
Open in new window
Then use jquery to remove the focus after a short period of time:
Open in new window
That should probably be a really easy way to do this.