1

I am trying to let a button shrink another element with jQuery. So far I came up with:

$( "#img1" ).click(function() {
    $("#img2").css("-moz-transform:scale", "0.7, 0.7"); 
});

But this doesn't seem to work. I am currently only worried about serving FireFox. I don't understand why my click function isn't working. I thought I defined everything correctly, I hope you can help out.

4
  • Can you put an alert("hello"); inside the .click function to make sure that code is even being called? Are there any errors in the console? Commented Jan 13, 2014 at 18:47
  • Your alert works just fine. :) Commented Jan 13, 2014 at 18:49
  • Why not just use animate scale from jquery UI? api.jqueryui.com/scale-effect Commented Jan 13, 2014 at 18:54
  • 1
    Note that jQuery automatically adds vendor prefixes for .css() in jQuery 1.8+ Commented Jan 13, 2014 at 18:59

1 Answer 1

4

Try this:

$( "#img1" ).click(function() {
  $("#img2").css("-moz-transform", "scale(0.7, 0.7)"); 
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.