I am trying to write a mobile application that has images instead of buttons as links.
How do I style this image link so that when it is pressed the image glows or appears darker or moves slightly or grows slightly bigger?
In my research on the internet I found the ui-btn class which has ui-btn-down-a, ui-btn-up-a and ui-btn-hover-a.
However in my case, this not a button, it’s an image which is a link.
How can I apply the effects?
UPDATE:
A good place to obtain transformation is http://westciv.com/tools/transforms/index.html
<div data-role="page" data-theme="a">
<div data-role="content" data-theme="a">
<a ontouchstart="" href ="wwww.yahoo.com"; class="ui-link-test">
<img class="icon" src="img/icon.png" alt="black-button.png">
</a>
</div>
</div>
Haradhania
box-shadowbackgrounda bit or apply a mask (mask could be a pseudo-element over it);marginor use atranslatetransform;widthandheightor use ascaletransform;For the second two, I’d recommend
transforms. They are supported by Android and have the advantage that moving or scaling the link won’t disturb (= move) the elements around it.Demo (keep mouse button pressed to see effects)
Relevant CSS:
NOTE: For
transforms you need to add the prefixed versions before the unprefixed version as no current version of any browser supports the unprefixed version (IE 10 and Firefox 16 have been announced to support transforms unprefixed):Same thing is valid if you want smooth
transitions: