Alex Onsman has Published 203 Articles

What is the difference between event.preventDefault() and event.stopPropagation() in jQuery?

Alex Onsman

Alex Onsman

Updated on 11-Dec-2019 07:24:07

141 Views

stopPropogation() methodTo stop the bubbling of an event to parent elements, use the stopPropagation() method.ExampleYou can try to run the following code to learn how to work with stopPropogation() method:Live Demo           jQuery stopPropagation() method                   ... Read More

Which jQuery events do not bubble?

Alex Onsman

Alex Onsman

Updated on 11-Dec-2019 07:22:01

112 Views

Some of the jQuery events, do not bubble such as mouseenter do not bubble. Let us see an example of such events.ExampleYou can try to run the following code to learn how to work with jQuery events, which do not bubble, Live Demo  $(document).ready(function(){     ... Read More

How to store and reproduce jQuery events?

Alex Onsman

Alex Onsman

Updated on 11-Dec-2019 07:10:43

111 Views

To store and reproduce jQuery events, use console to log.ExampleYou can try to run the following code to learn how to store and reproduce jQuery events:Live Demo $(document).ready(function(){     window.events = []     $("#track").click(function(event){        window.events.push(event)            $.each(window.events, function(i, ... Read More

What is difference between innerWidth and outerWidth in jQuery?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:37:56

154 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 ... Read More

What is the difference between innerHeight and outerHeight in jQuery?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:35:49

290 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       ... Read More

What does jQuery.offset() method do in jQuery?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:33:02

74 Views

The offset() method gets the current offset of the first matched element, in pixels, relative to the document.ExampleYou can try to run the following code to learn how to use offset() method in jQuery:Live Demo           jQuery offset() method             ... Read More

What is the difference between jQuery.position() and jQuery.offset() in jQuery?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:26:55

217 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 ... Read More

How to implement jQuery ScrollLeft with easing?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:23:47

152 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   ... Read More

How does jQuery.scrollTop() work?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:21:36

169 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     ... Read More

How does jQuery.scrollLeft() work?

Alex Onsman

Alex Onsman

Updated on 10-Dec-2019 06:19:21

181 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   ... Read More

Advertisements