(function($){
$(".content").mCustomScrollbar({
axis:"y",
callbacks:{
whileScrolling: function(){
var x = this.mcs.content.find('.ef');
var d = -this.mcs.top;
x.each(function(i){
console.log(d);
var g = $(this).position().top;
var gh = $(this).height();
console.log(Math.round(gh));
if(d > Math.round(g) - 400) {
$(this).addClass('go');
}
});
}
}
});
})(jQuery);
var arr1 = [1, 3, 5, 7];
arr2 = [2, 6, 10];
var counter1 = 0;
counter2 = 0;
counter3 = 0;
counter4 = 0;
counter5 = (arr1.length + arr2.length) / 2;
endCounter = 0;
totalCounter = 0;
for(; totalCounter < Math.round(counter5); totalCounter++){
counter4 = counter3;
if(arr1[counter1] <= arr2[counter2]) {
counter3 = arr1[counter1];
counter1++;
} else {
counter3 = arr2[counter2];
counter2++;
};
};
if(counter5 != Math.round(counter5)){
endCounter = (counter3 + counter4) / 2;
} else {
endCounter = counter3;
};