Skip to main content

Premium.presetcss

Premium.presetcss is only available in version >=2.4.7

This component is to help presetting inline CSS. Useful for consistent animations when using tweening libraries.

[jp-gsap]

HTML attribute to set CSS properties to be preset by the gsap tweening library. It takes a space-delimited list of property:value pairs.

<button class="cta" jp-gsap="left:50% x:30">Buy Now</button>

The above would be equivalent of this in JavaScript:

gsap.set(".cta", {left:"50%", x:30});

.jp-gsap-x .jp-gsap-y .jp-gsap-xy

These are shortcut classes to achieve the most commonly required gsap presets with a simple class.

<button class="cta jp-gsap-x">Buy Now</button>
 
jp-gsap-xsets xPercent:-50
jp-gsap-ysets yPercent:-50
jp-gsap-xysets xPercent:-50 and yPercent:-50