Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

jQuery 2d transformation plugin

NotificationsYou must be signed in to change notification settings

heygrady/transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

As a note, I'm no longer maintaining this library. There was a much simpler library by Louis Remi. I forked it a while back and ported over the portions of my library that were missing from his. Louis' approach is much simpler and more performant.

My fork ishere

Louis Remi's ishere

2D Transformations

This library uses native CSS3 transformations in supported browsers and relies on the matrix filter in Internet Explorer 8 and below.

NOTE: In Internet Explorer 8 and below, the transform-origin and the translate functions are simulated using relative positioning. Because of this, in Internet Explorer 8 and below, the top and left position of an element will be incorrect after it has been transformed. Thesolution is to wrap the element that is to be transformed and position that wrapper instead.

  • Since 0.9.0, proper units are required
  • Since 0.9.0, jQuery 1.4.3 or above is required

Supported Browsers

  • Native CSS3 Support
    • FireFox 3.5+
    • Safari 3.1+
    • Chrome
    • Opera 10.5+
    • Internet Explorer 9+
  • Matrix Filter Support
    • Internet Explorer 5.5 - 8

Usage

// Rotate 30 Degrees$('#example').transform({rotate: '30deg'});// Use CSS Hooks to Rotate$('#example').css({rotate: '30deg'});// Animate the rotation$('#example').animate({rotate: '30deg'});// Go Crazy$('#example').transform({matrix: [1, 0, 0, 1, 0, 0], //applies a matrixreflect: true, //same as rotate(180deg)reflectX: true, //mirrored upside downreflectXY: true, //same as reflectX + rotate(-90deg)reflectY: true, //mirroredrotate: '45deg', //rotates 45 degreesskew: ['10deg', '10deg'], //skews 10 degrees on the x and y axisskewX: '10deg', //skews 10 degrees on the x axisskewY: '10deg', //skews 10 degrees on the y axisscale: [1.5, 1.5], //scales by 1.5 on the x and y axisscaleX: 1.5, //scales by 1.5 on the x axisscaleY: 1.5, //scales by 1.5 on the y axistranslate: ['20px', '20px'], //moves the transformation 20px on the x and y axistranslateX: 20px', //moves the transformation 20px on the x axistranslateY: '20px', //moves the transformation 20px on the y axisorigin: ['20%', '20%']  //changes the transformation origin});// Properties can be strings or arrays$('#example').css({skew: ['10deg', '10deg']});$('#example').css({skew: '10deg, 10deg'});// For animation, arrays should be nested because of jQuery's per-property easing support$('#example').animate({skew: ['10deg', '10deg']}); // technically this defines nonsense easing of 10deg$('#example').animate({skew: [['10deg', '10deg']]}); // this is a friendlier way of supporting this

About

jQuery 2d transformation plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp