Handle click event on transformed element - Javascript CSS Style Property

Javascript examples for CSS Style Property:transform

Description

Handle click event on transformed element

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <style>

#rect{/*from w ww .  ja  va 2s.co  m*/
   width:200px;
   height:200px;
   background-color:red;
   -webkit-transform:translate3d(0px, -28px, 200px) perspective(1000px) rotateX(45deg) scale(0.43068391866913125)
}

      </style> 
   </head> 
   <body> 
      <div id="rect"></div> 
      <script>
var rect = document.getElementById("rect");
rect.onclick = function(){console.log("click");};

      </script>  
   </body>
</html>

Related Tutorials