Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
40
rated 0 times [  47] [ 7]  / answers: 1 / hits: 25627  / 13 Years ago, thu, october 27, 2011, 12:00:00

I have a page with a textbox in it. When I scroll the textbox to the bottom, the document will scroll after it. How to disable mouse scrolling for the document but enable scrolling for the textbox when mouse is over textbox? I only need to disable mouse scroll and not window scrollbars.



The page has a fixed size and there will only be scrollbars when the browser window is not maximized. The document has a 800x600 px size and should fit for most users I think.



I'm using JavaScript with jQuery.


More From » jquery

 Answers
91
$('#txt').hover(function (){
$('body').css('overflow','hidden');
}, function (){
$('body').css('overflow','auto');
})

[#89427] Tuesday, October 25, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aubriechantalr

Total Points: 380
Total Questions: 95
Total Answers: 86

Location: Guadeloupe
Member since Sat, Aug 22, 2020
4 Years ago
;