- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10711 Articles for Web Development
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
7K+ Views
To set scrolltop position in jQuery, use the scrollTop() method. The scrollTop( ) method gets the scroll top offset of the first matched element. This method works for both visible and hidden elements.ExampleYou can try to run the following code to set scrollTop() method in jQuery:Live Demo jQuery scrollTop() method $(document).ready(function(){ $("div.demo").scrollTop( 200 ); $("div.demo").mousemove(function () { ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
203 Views
The scrollLeft( ) method gets the scroll left offset of the first matched element. This method works for both visible and hidden elements.ExampleYou can try to run the following code to learn how to work with jQuery.scrollLeft() method:Live Demo jQuery scrollLeft() method $(document).ready(function(){ $("div.demo").scrollLeft( 200 ); $("div.demo").mousemove(function () { var ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
234 Views
jQuery position() methodThe position() method gets the top and left position of an element relative to its offset parent.The returned object contains two Integer properties, top and left. For accurate calculations make sure to use pixel values for margins, borders and padding. This method only works with visible elements.ExampleYou can try to run the following code to learn how to work with position() method in jQuery:Live Demo The jQuery Example $(document).ready(function() { ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
194 Views
The scrollTop( ) method gets the scroll top offset of the first matched element. This method works for both visible and hidden elements.ExampleYou can try to run the following code to learn how to work with scrollTop() method:Live Demo jQuery scrollTop() method $(document).ready(function(){ $("div.demo").scrollTop( 200 ); $("div.demo").mousemove(function () { var top ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
172 Views
To implement jQuery ScrollLeft, use the jQuery Easing plugin. The easing plugin is used for animation.You need to first add the Easing Plugin library. Let’s add the CDN:script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.4.1/jquery.easing.compatibility.min.js">Example You can try to run the following code to implement jQuery ScrollLeft with easing:Live Demo $(document).ready(function() { $("#button1").click(function() { jQuery.easing.def = 'easeOutBounce'; $('#test').animate({"margin-left": '100'}, 'slow'); }); }); #test { width:150px; height:150px; background-color:#6C220A; } Scroll
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
96 Views
jQuery.offsetParent( ) methodThe offsetParent( ) method returns a jQuery collection with the positioned parent of the first matched element.This is the first parent of the element that has position (as in relative or absolute). This method only works with visible elements.ExampleYou can try to run the following code to learn how to work with jQuery.offsetParent() and jQuery.parent() methods in jQuery −Live Demo jQuery offsetParent() method $(document).ready(function() { ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
174 Views
Width in jQueryThe width() is the horizontal measurement of the container, for example, width of a div. It excludes the padding, border, or margin.ExampleYou can try to run the following code to learn how to get the width of an element in jQuery:Live Demo $(document).ready(function(){ $("button").click(function(){ alert("Width of div element: " + $("div").width()); }); }); Get Width of div outerWidth in jQueryThe outerWidth() returns the outer width of the first matched element. It includes padding and border.ExampleYou can try to run ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
181 Views
Width in jQueryThe width is the horizontal measurement of the container, for example, width of a div. It excludes the padding, border, or margin.ExampleYou can try to run the following code to learn how to get the width of an element in jQuery:Live Demo $(document).ready(function(){ $("button").click(function(){ alert("Width of div element: " + $("div").width()); }); }); Get Width of div innerWidth in jQueryThe innerWidth() returns the inner width of the first matched element. It includes padding, but not border and margin.ExampleYou can ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
184 Views
innerWidth in jQueryThe innerWidth() returns the inner width of the first matched element. It includes padding, but not border and margin.ExampleYou can try to run the following code to get the inner width in jQuery:Live Demo $(document).ready(function(){ $("button").click(function(){ alert("Inner Width of div element: " + $("div").innerWidth()); }); }); Get Inner Width of div outerWidth in jQueryThe outerWidth() returns the outer width of the first matched element. It includes padding and border.ExampleYou can try to run the following code to ... Read More
![Alex Onsman](https://www.tutorialspoint.com/assets/profiles/13357/profile/60_91536-1512482971.jpg)
320 Views
innerHeight in jQueryThe innerHeight() method gets the inner height (excludes the border and includes the padding) for the first matched element.ExampleYou can try to run the following code to learn how to work with innerHeight in jQuery:Live Demo jQuery innerHeight() method $(document).ready(function() { $("div").click(function () { var color = $(this).css("background-color"); var height ... Read More