23 Feb 2016

This article will take about 1 minute to read.
No comments

Again, I’ve seen it somewhere on the internet and recreated it. This one uses jQuery, although I plan to rewrite it to vanilla JavaScript.

It switches between two sides of the cube, every time you hover. Depending from which side cursor entered the cube, it will rotate in opposite direction. It is fully responsive, and on touch devices, direction depends of where you tap.

Cube side is a regular div, and you can put any type of content in it.

Demo - 3D Rotating cubes hover effect

Works on every modern browser, but on IE it falls back to fade effect. Thing is that Internet Explorers do not support transform-style: preserve-3d property. More on MDN.

Check the demo. Documentation is on the same page.

Grab the code on GitHub.

Warning: Every person I introduced to this played with it for ages :)

Category
JavaScript CSS/SASS

No comments, be the first to comment

Sending failed, please try again.
Thank you! Your comment is sent. Please note that all of the comments go through moderation.