3D Rotating Cube In jQuery - Cubelet.js

File Size: 75.3 KB
Views Total: 1085
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
3D Rotating Cube In jQuery - Cubelet.js

Cubelet.js is a jQuery plugin to create a 3D cube that is rotatable and scalable using CSS3 rotateX, rotateY, rotateZ, and scale properties.

How to use it:

1. Load the Cubelet.js plugin after jQuery library.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/dist/jquery.cubelet.js"></script>

2. Create a container in which you wish to place the 3D rotating cube.

<div class="example-cubelet"></div>

3. Initialize the 3D rotating cube.

var $cubelet = $('.example-cubelet');

4. Get the current rotation coordinates of the cube.

// returned object:
{ x: number, y: number, z: number, scale: number }

5. Set the rotation coordinates of the Cubelet. Sets the internal state of the widget as well as the inline CSS rotate styles. The coordinates parameter accepts any object with the following format:

  x: number=, y: number=, z: number=, scale: number=

6. Show & hide the Cubelet.

// show

// hide

// check if is shown

7. Takes the Cubelet's current rotation coordinates and apply them to another jQuery collection. Note that this will overwrite any inline transform styles currently set on these elements.


This awesome jQuery plugin is developed by jeremyckahn. For more Advanced Usages, please check the demo page or visit the official website.