Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Send to Bottom of Div Element on User Scroll

Currently, my website works well with the standard user scroll, however, I would like to implement something like this where when the user scrolls, it sends them to the bottom or center of the div element. I assume these elements have a height:100vh. Can someone help, please? Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

copy and paste this code on your index.js

and custom code or var elm

        var element = ".et_pb_section";
        $(element).each(function (index) {
            // accept 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);
                // wheel top to bottom
                if (delta < 0) {

                    if ($(elementSelecter).next() != undefined) {
                        try {
                            moveTop = $(elementSelecter).next().offset().top;
                        } catch (e) {}
                    }
                    // wheel bottom to top
                } else {
                    if ($(elementSelecter).prev() != undefined) {
                        try {
                            moveTop = $(elementSelecter).prev().offset().top;
                        } catch (e) {}
                    }
                }
                // move (0.5sec)
                $("html,body").stop().animate({
                    scrollTop: moveTop + 'px'
                }, {
                    duration: 500,
                    complete: function () {}
                });
            });
        });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!