You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: page/events/introduction-to-custom-events.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -19,10 +19,10 @@ Why should you care? An example is probably the best way to explain. Suppose you
19
19
20
20
```
21
21
<div class="room" id="kitchen">
22
-
<div class="lightbulb on"></div>
23
-
<div class="switch"></div>
24
-
<div class="switch"></div>
25
-
<div class="clapper"></div>
22
+
<div class="lightbulb on">Kitchen light</div>
23
+
<div class="switch">Kitchen switch 1</div>
24
+
<div class="switch">Kitchen switch 2</div>
25
+
<div class="clapper">Kitchen clapper switch</div>
26
26
</div>
27
27
```
28
28
@@ -65,18 +65,18 @@ Let's make our example a little more interesting. We'll add another room to our
65
65
66
66
```
67
67
<div class="room" id="kitchen">
68
-
<div class="lightbulb on"></div>
69
-
<div class="switch"></div>
70
-
<div class="switch"></div>
71
-
<div class="clapper"></div>
68
+
<div class="lightbulb on">Kitchen light</div>
69
+
<div class="switch">Kitchen switch 1</div>
70
+
<div class="switch">Kitchen switch 2</div>
71
+
<div class="clapper">Kitchen clapper switch</div>
72
72
</div>
73
73
<div class="room" id="bedroom">
74
-
<div class="lightbulb on"></div>
75
-
<div class="switch"></div>
76
-
<div class="switch"></div>
77
-
<div class="clapper"></div>
74
+
<div class="lightbulb on">Bedroom light</div>
75
+
<div class="switch">Bedroom switch 1</div>
76
+
<div class="switch">Bedroom switch 2</div>
77
+
<div class="clapper">Bedroom clapper switch</div>
78
78
</div>
79
-
<div id="master_switch"></div>
79
+
<div id="master_switch">Master switch</div>
80
80
```
81
81
82
82
If there are any lights on in the house, we want the master switch to turn all the lights off; otherwise, we want it to turn all lights on. To accomplish this, we'll add two more custom events to the lightbulbs: `light:on` and `light:off`. We'll make use of them in the `light:toggle` custom event, and use some logic to decide which one the master switch should trigger:
Copy file name to clipboardExpand all lines: page/plugins.md
+6
Original file line number
Diff line number
Diff line change
@@ -14,3 +14,9 @@ A jQuery plugin is simply a new method that we use to extend jQuery's prototype
14
14
The idea of a plugin is to do something with a collection of elements. You could consider each method that comes with the jQuery core a plugin, like `.fadeOut()` or `.addClass()`.
15
15
16
16
You can make your own plugins and use them privately in your code or you can release them into the wild. There are thousands of jQuery plugins available online. The barrier to creating a plugin of your own is so low that you'll want to do it straight away!
17
+
18
+
While most existing jQuery plugins are stateless – that is, we call them on an element and that is the extent of our interaction with the plugin – there's a large set of functionality that doesn't fit into the basic plugin pattern.
19
+
20
+
In order to fill this gap, jQuery UI has implemented a more advanced plugin system. The new system manages state, allows multiple functions to be exposed via a single plugin, and provides various extension points. This system is called the Widget Factory and is exposed as `jQuery.widget` as part of jQuery UI 1.8; however, it can be used independently of jQuery UI.
21
+
22
+
For details on the capabilities of the Widget Factory, see this [How To Use the Widget Factory](/jquery-ui/widget-factory/how-to-use-the-widget-factory/).
0 commit comments