A tiny requestAnimationFrame powered 60+fps lightweight parallax tilt effect for jQuery.
Take a look at the landing page for demos.
<!DOCTYPE html><body><divdata-tilt></div><!-- Tilt element --><scriptsrc="jquery.js" ></script><!-- Load jQuery first --><scriptsrc="tilt.js"></script><!-- Load Tilt.js library --></body>maxTilt: 20,perspective: 1000,// Transform perspective, the lower the more extreme the tilt gets.easing: "cubic-bezier(.03,.98,.52,.99)",// Easing on enter/exit.scale: 1,// 2 = 200%, 1.5 = 150%, etc..speed: 300,// Speed of the enter/exit transition.transition: true,// Set a transition on enter/exit.disableAxis: null,// What axis should be disabled. Can be X or Y.reset: true,// If the tilt effect has to be reset on exit.glare: false,// Enables glare effectmaxGlare: 1// From 0 - 1.consttilt=$('.js-tilt').tilt();tilt.on('change',callback);// parameters: event, transformstilt.on('tilt.mouseLeave',callback);// parameters: eventtilt.on('tilt.mouseEnter',callback);// parameters: eventconsttilt=$('.js-tilt').tilt();// Destroy instancetilt.tilt.destroy.call(tilt);// Get values of instancetilt.tilt.getValues.call(tilt);// returns [{},{},etc..]// Reset instancetilt.tilt.reset.call(tilt);- yarn:
yarn add tilt.js - npm:
npm install --save tilt.js
