rotate

by Chandana Thota

HTML

<!--rotate on click -->
<div id="div2">This is Div#2</div>

CSS

#div2 {
    background-color:green;
    color:white;
    font-family: Arial;
    width:200px;
    height:200px;
}

.box_rotate {
  -webkit-transform: rotate(7.5deg);  /* Chrome, Safari 3.1+ */
     -moz-transform: rotate(7.5deg);  /* Firefox 3.5-15 */
      -ms-transform: rotate(7.5deg);  /* IE 9 */
       -o-transform: rotate(7.5deg);  /* Opera 10.50-12.00 */
          transform: rotate(7.5deg);  /* Firefox 16+, IE 10+, Opera 12.50+ */
}

JavaScript

$("#div2").click(someFunction);

function someFunction() {
    $(this).addClass('box_rotate ');
}