0

What is wrong with this Code?

$("button").click(function(){
    var div=$("#oarm2");
    div.animate({marginTop:'150px', transform:'skew(15deg, -60deg)'},"slow");
});

When I press the button, an div Element should be go down in the Page and change the Form.

The "marginTop" is functionally, but the transform skew not..

What is wrong? How I must write this?

Imperative
  • 3,138
  • 2
  • 25
  • 40
  • Coud you please create a jsfiddle here - http://jsfiddle.net/ ? Makes it easier to correct your code. – Robin May 26 '14 at 10:50
  • 1
    You may also directly use a CSS transition or animation (in contrast to that JS animation…) – feeela May 26 '14 at 10:50
  • Yes, wait an Moment ;) – user3676054 May 26 '14 at 10:50
  • 2
    possible duplicate of [Animate element transform rotate](http://stackoverflow.com/questions/5462275/animate-element-transform-rotate) or http://stackoverflow.com/questions/16958873/jquery-animate-a-webkit-transform – feeela May 26 '14 at 10:51

1 Answers1

0

Check this Demo Fiddle

Js

$("#go").click(function(){    
     $("#oarm2").animate({marginTop:'150px', transform:'skew(15deg, -60deg)'},"slow"); });

HTML

<button id="go">&raquo; Run</button>
<div id="oarm2">Hello!</div>

CSS

div {
    background-color: #bca;
    width: 100px;
    border: 1px solid green;
  }

Here I include jquery library file jquery-1.8.3.js

Community
  • 1
  • 1
Prashant
  • 704
  • 10
  • 23