Answer the question
In order to leave comments, you need to log in
For some reason, the Scroll jquery action is repeated 2 times instead of once, what could be the problem?
I use the Mausevel plugin, for some reason this script repeats all this 2 times, well, this is because there are 2 elements. If there are more elements, then there will be more repetitions.
$(window).on('mousewheel', function(event) {
var CL = $(".case-left"), CR = $(".case-right"), CLHeight = CL.height(), CR = CR.height(), CLength = CL.length;
$(window).resize(function() {
var CLHeight = CL.height(), CR = CR.height();
});
for(var i = 1; i < CLength; i++) {
if(event.deltaY > 0)
CL.animate({ "top": CLHeight }, 200);
console.log(CLHeight);
if(event.deltaY < 0)
CL.animate({ "top": -CLHeight }, 200);
console.log(CLHeight);
}
});
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