Cameron
Cameron

Reputation: 671

stop scrolling of webpage with jquery

I am using a query bumpbox plugin with the webpage, I am working on but I can still scroll away from the bumpbox when I am using it. I was wondering if there was some sort of jquery method that will keep the webpage from scrolling or just scroll the opposite way with the same distance that the user scrolled.

Upvotes: 1

Views: 7856

Answers (2)

Tarun Gupta
Tarun Gupta

Reputation: 6403

Easiest way to achieve this

$("body").css("overflow", "hidden");

Upvotes: 1

adeneo
adeneo

Reputation: 318352

It's hard to be specific with no code posted, but to prevent scrolling you could do something like :

$(window)​​.on('scroll', function() {
    $(this).scrollTop(100); //sets the scrollposition to 100px
})​​;​

FIDDLE

Upvotes: 4

Related Questions