Skip to content

stipsan/Element.Style.Transform.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Element.Style.Transform

Provides a cross browser way of letting you use the CSS3 transform property. Inspired by http://github.com/zachstronaut/jquery-css-transform

Screenshot

ie support isn't there yet

As this post explains near the end: http://www.zachstronaut.com/posts/2009/02/22/jquery-patch-css-transform.html Using IEs matrix filter directly can make it possible to animate it. However the Matrix Filter is anything but easy to wrap your head around: http://msdn.microsoft.com/en-us/library/ms533014(VS.85).aspx So please be patient :)

How to Use

#JS
$('box').set('transform', 'scale(2)')
        .get('transform');           // Returns 'scale(2)'
		
$('box').setTransform('rotate(15deg)')
        .getTransform();              // Returns 'rotate(15deg)'

$('box').getStyle('transform'); unfortunately does not work. Neither does setStyle. I haven't found a way to extend those methods to make it work cross browser engine yet. So with those, you'll have to use the correct browser vendor prefixes.

#JS
$('box').getStyle('webkit-transform') // Safari and Chrome
        .getStyle('moz-transform')    // Firefox
        .getStyle('o-transform');      // Opera

About

Provides a cross browser way of letting you use the CSS3 transform property. Inspired by http://github.com/zachstronaut/jquery-css-transform

Resources

Stars

Watchers

Forks

Packages

No packages published