add this snippet to your index.js file
and include custom code or var elm
var element = ".et_pb_section";
$(element).each(function (index) {
// handle mouse wheel event individually
$(this).on("mousewheel DOMMouseScroll", function (e) {
e.preventDefault();
var delta = 0;
if (!event) event = window.event;
if (event.wheelDelta) {
delta = event.wheelDelta / 120;
if (window.opera) delta = -delta;
} else if (event.detail)
delta = -event.detail / 3;
var moveTop = $(window).scrollTop();
var elementSelecter = $(element).eq(index);
// scrolling from top to bottom
if (delta < 0) {
if ($(elementSelecter).next() != undefined) {
try {
moveTop = $(elementSelecter).next().offset().top;
} catch (e) {}
}
// scrolling from bottom to top
} else {
if ($(elementSelecter).prev() != undefined) {
try {
moveTop = $(elementSelecter).prev().offset().top;
} catch (e) {}
}
}
// animate scroll (0.5sec)
$("html,body").stop().animate({
scrollTop: moveTop + 'px'
}, {
duration: 500,
complete: function () {}
});
});
});