Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VelocityJS(velocity-animate) + WebPack - How can I use it?

I have started using Webpack and I have installed VelocityJS(velocity-animate) from NPM.

I am importing it like this

import Velocity from 'velocity-animate';

but I don't really know how to use it.

For example ... How would I write this?

$('.secondary-content').velocity({translateX: '0%'});

I have tried this but it did not work.

Velocity.$('.secondary-content').velocity({translateX: '0%'})

like image 785
QoP Avatar asked Sep 25 '22 22:09

QoP


1 Answers

import Velocity from 'velocity-animate';
Velocity(toAnim, { opacity: 0.05 }, 1000);

Quelle: https://www.smashingmagazine.com/2014/09/animating-without-jquery/

My tested platform: + [email protected] + [email protected] + [email protected] + [email protected] + [email protected]

cheers! :D

like image 167
Gfast2 Avatar answered Oct 11 '22 13:10

Gfast2