Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what jQuery event expression mean when it has a dot in it

Tags:

jquery

events

I was reading through a jQuery plugin and found a weird event(at lease to me) expression like following:

$(this).find('ul:first').bind('scroll.sticky', function(e) {     //some code; }); 

The question is what does ".sticky" mean? I only know the "scroll" part. I tried to search jQuery document but didn't found anything. Can you point me the right page?

Thanks a lot.

like image 639
quarterwind Avatar asked Sep 06 '12 08:09

quarterwind


People also ask

What is the use of dot symbol in jQuery?

Alternatively, the dot symbol . means the element is a CSS class. So . row would match <div class="row"> .

What is event bubbling in jQuery?

Event bubbling directs an event to its intended target, and works like this: When an object (like a button) is clicked, an event is directed to the object. If an event handler is set for the object, the event handler is triggered. Then the event bubbles up (like a bubble in water) to the objects parent.

When an event reaches an element all handlers bound to that event type for the element are fired?

When an event reaches an element, all handlers bound to that event type for the element are fired. If there are multiple handlers registered, they will always execute in the order in which they were bound. After all handlers have executed, the event continues along the normal event propagation path.


1 Answers

Those are namespaced events.

Ref: https://api.jquery.com/event.namespace/

like image 112
2 revs Avatar answered Oct 05 '22 17:10

2 revs