Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css3-translate

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css3-translate

A tiny, functional CSS3 translation transforms API that shims browser-specific APIs.

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

CSS3 translate

A tiny (900 bytes minified, 470 bytes gziped), functional CSS3 translation transforms API for JavaScript. Supports all browsers supporting CSS3 Transforms. Check out the support grid.

3D transforms - translate.z and translate.d3 - have a separate support grid.

Install

git clone https://github.com/mattcg/css3-translate.git
cd css3-translate/
make
cp build/translate.min.js /path/to/my-project/js/

Alternatively, use Component, Bower or npm to install to your project as a dependency.

API

For all translation methods, if a length does not include units, px will be used.

translate(tx, ty)

Apply a translate(tx, ty) CSS transform to the given element, moving the position of the element on the plane.

If missing, ty is assumed to be equal to tx: translate(2) means translate(2, 2).

translate.x(tx)

Apply a translateX(tx) CSS transform to the given element, moving the element horizontally on the plane.

translate.y(ty)

Apply a translateY(ty) CSS transform to the given element, moving the element vertically on the plane.

translate.z(tz)

Apply a translateZ(tz) CSS transform to the given element, moving the element along the z-axis of the 3D space.

translate.d3(tx, ty, tz) or translate['3d'](tx, ty, tz)

Apply a translate3d(tx, ty, tz) CSS transform to the given element, moving the position of the element in the 3D space.

translate.rule()

Get the browser-specific transform rule e.g. 'webkitTransform' or 'transform'.

License

Copyright © 2013 Matthew Caruana Galizia, licensed under an MIT license.

Keywords

FAQs

Package last updated on 23 May 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc