Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery .addClass() with less mixins

I have a JQuery function that adds classes to an element. I want to use the http://daneden.me/animate/ animation package. To do this, I needed to add two classes, "animated" and "animation type example", to my element. However, instead of adding a simple animation class, I wanted to change animate.css to animate.less so that I could pass in mixin parameters. But the JQuery addClass() function doesn't recognize my code as being valid.

ex] .animated{//effects} has already been changed to: .animated(@duration, @delay){//effects}

The code that works without mixins:

function waterColorAnmiation(){
    $("#stroke1").addClass("animated fadeInUp");
}

What I've tried in order to use mixins for @duration & @delay:

function waterColorAnmiation(){
    $("#stroke1").addClass("animated(1, 3) fadeInUp");
}

Please let me know if you have suggestions or if there is a much easier way to accomplish this. Thanks!

like image 624
user1574832 Avatar asked Oct 03 '22 19:10

user1574832


1 Answers

You can't do that, you need to define a new class for the mixin animated(1, 3) then use it like In your less file

.animated13 {
    .animated(1, 3);
}

then

$("#stroke1").addClass("animated13 fadeInUp");
like image 118
Arun P Johny Avatar answered Oct 07 '22 17:10

Arun P Johny