views:

37

answers:

2

I know, a very simple question, but I don't know!

I have:

.touch img{
-webkit-transform: scale(2);
}


How would I make that activate when someone clicks on the element?

Thanks!

+1  A: 
$(function() {
 $('#click').click(function() {
    $('.touch img').css({'-webkit-transform' : 'scale(2)'})
 });
});

This should work :)

Ninja Dude
+1  A: 

Make it:

.touch img.clicked

And use the script:

$(".touch img").click(function(){this.addClass("clicked")});
mattbasta