Answer the question
In order to leave comments, you need to log in
Script from jQuery to Vue?
There was a task - to transfer the page to vue js,
moreover, they said to connect jq and transfer all scripts. But, and then I want to completely transfer to vue.
And then I ran into difficulty, there is an animation script written in Jq
How can it be translated into vue?
function next(len) {
var i = -1;
return function () {
i++;
return i == len ? -1 : i;
};
}
$('.main__block').hover(
function () {
var $circle = $(this).find('.circle');
var pos = next($circle.length),
current,
timer = setInterval(function () {
current = pos();
current == -1 ? clearInterval(timer) : $circle.eq(current).addClass('active')
}, 100);
}, function () {
var $circle = $(this).find('.circle');
var pos = next($circle.length),
current,
timer = setInterval(function () {
current = pos();
current == -1 ? clearInterval(timer) : $circle.eq(current).removeClass('active')
}, 100);
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question