Skip to content

chrisbateman/Motionizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

#Motionizer

Motionizer moves rotates an element in 3d space (using CSS3 transforms), based on device motion. As far as I know, right now this only works on iOS 4.2+.

Usage

Include the script on your page and simply call the Motionizer function, passing in the element to apply the effect to. An optional second parameter (a boolean) controls whether the element should rotate around the z-axis.

Motionizer("elementId");
// or
Motionizer("elementId", false);
// or
Motionizer(document.getElementById("elementId"));

Remember that if you want a perspective effect to be applied to the element (and you probably do), you need to add a perspective style to a parent element. You can see a simple demo here.

About

Rotates an element in 3d space, based on device motion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published