I'm pretty sure you could add a JS click event to animate the image quite easily (I assume you would have a special image class) but right click might be somewhat harder.
I guess the question we need to ask is why do you want this effect and how would it be used?
As soon as Chris had to google how to write a css link I was out. Why would I want to learn a new language? I assume its faster. By what 2 milliseconds?
Hello guys, Please help me with this. When someone click on a image, then it vibrates.. :)
Is that all it's supposed to do?
For how long, in what direction, up and down, side to side?
Do you mean for a smartphone and you want tactile feedback?
I want the image to vibrate side to side onclick and it vibrates as long as we right click on that image :)
I think that's reserved for the OS isn't it?
I'm pretty sure you could add a JS click event to animate the image quite easily (I assume you would have a special image class) but right click might be somewhat harder.
I guess the question we need to ask is why do you want this effect and how would it be used?
My bad ahhhh... i want t to vibrate ion left click javascript will work for me :)
i saw in on a website. Tried a hand on it, but wasn't successful :(
A CSS animation using translate enabled on :active would be a quick and clean solution. If you want a deeper browser support, then you'll need JS.
What site?
Could you pit what you have in Codepen and let us play with it?
There you go: http://codepen.io/HugoGiraudel/pen/8a674c9a943c9c7f2060c06fcebccf43
what's &:active? The & specifically
@Eric, in SASS, it concatenates the parent element, in this case
imgso it's technicallyimg:activeDoes SASS work on JS backbone or php?
You might find this useful if you're new to SASS: http://css-tricks.com/video-screencasts/111-get-yourself-preprocessing-in-just-a-few-minutes/ .
As soon as Chris had to google how to write a css link I was out. Why would I want to learn a new language? I assume its faster. By what 2 milliseconds?
@Eric - once you start using SCSS you'll never look back. It's not faster, since it just compiles down to regular CSS, but you'll write faster.
I'm used to SCSS. I didn't even thing about it when making your demo. Whatever, I think it's pretty much what you asked for, right?