Gourav Makhija February 2016

Jquery dlmenu animation is not smooth

I have created multilevel navigation menu using jquery dlmenu plugin v1.0.2 demo2.

Everything works fine, except CSS3 menu navigation is not smooth as jQuery left/right slide functionality is.

Is there any solution to resolve this issue without changing plugin?

/* Animation classes for moving out and in */

.dl-menu.dl-animate-out-2 {
    -webkit-animation: MenuAnimOut2 0.3s ease-in-out forwards;
    -moz-animation: MenuAnimOut2 0.3s ease-in-out forwards;
    animation: MenuAnimOut2 0.3s ease-in-out forwards;    
}
@-webkit-keyframes MenuAnimOut2 {
    100% {
        -webkit-transform: translateX(-100%);
        opacity: 0;
    }
}

@-moz-keyframes MenuAnimOut2 {
    100% {
        -moz-transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes MenuAnimOut2 {
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.dl-menu.dl-animate-in-2 {
    -webkit-animation: MenuAnimIn2 0.3s ease-in-out forwards;
    -moz-animation: MenuAnimIn2 0.3s ease-in-out forwards;
    animation: MenuAnimIn2 0.3s ease-in-out forwards;
}

@-webkit-keyframes MenuAnimIn2 {
    0% {
        -webkit-transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateX(0px);
        opacity: 1;
    }
}

@-moz-keyframes MenuAnimIn2 {
    0% {
        -moz-transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        -moz-transform: translateX(0px);
        opacity: 1;
    }
}

@keyframes MenuAnimIn2 {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0px);
        opacity: 1;
    }
}

Answers


smdsgn February 2016

You have to use the plugin like this : with animationClasses "in" and "out" not "classin" and "classout"

$(function() {
  $( '#dl-menu' ).dlmenu({
    animationClasses : { in : 'dl-animate-in-2', out : 'dl-animate-out-2' }
  });
});

Post Status

Asked in February 2016
Viewed 3,675 times
Voted 8
Answered 1 times

Search




Leave an answer