I want to get the body element of an html using jquery and then disable the vertical scrolling?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this…
$('body,html').css('overflow','hidden');the
,htmlallows you to also include the<html>because some browsers may use that as the base as oppose to the<body>tag so it helps treating both as if they were one.helpful
any tag should be selected like so
$('a');or$('body');an element can be selected by
idusing the prefix#so<a id="c_1" >CLick Me</a>or by
classwith the prefix.<a class="classname">Click Me</a>for more information read http://api.jquery.com/category/selectors/
as for the scroll bars they are controlled by css, you could simply go on a css file and do the following.
body, html {overflow: hidden;}the
overflowparameter allows you to control what happens when contentoverflowthe assigned width and hight.http://reference.sitepoint.com/css/overflow
or the proper reference http://www.w3.org/TR/CSS2/visufx.html
sorry if this is too technical, but one day you would have to learn about these 🙂