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
[jQuery.compare](http://donejs.com/docs.html#!jQuery.compare) adds `$.fn.compare` to compare the position of two nodes. It returns a number that represents a bitmask showing how they are positioned relative to each other. The following list shows the `bitmask`, the __number__ and what it means for a `$.fn.compare` call like `$('#foo').compare($('#bar'))`:
135
139
136
140
*`000000` -> __0__: Elements are identical
@@ -154,6 +158,8 @@ This is useful to rapidly compare element positions which is common when widgets
[jQuery.cookie](http://donejs.com/docs.html#!jQuery.cookie) packages Klaus Hartl's [jQuery cookie](https://github.com/carhartl/jquery-cookie) plugin for manipulating cookies. Use it like:
158
164
159
165
{% highlight javascript %}
@@ -177,10 +183,12 @@ The example uses `jQuery.cookie` and [formParams](#formParams) to persist a form
177
183
or load it from the value stored in the cookie. At the bottom it shows the current cookie value after running it through
[jQuery.dimensions](http://donejs.com/docs.html#!jQuery.dimensions) overwrites `$.fn.innerWidth`, `$.fn.outerWidth`, `$.fn.innerHeight`, `$.fn.outerHeight` and enables `$.fn.animate` to animate these values. Inner dimensions include the padding where outer dimensions also take care of borders and margins (if *includeMargin* is set to `true`). Set and read these values using:
185
193
186
194
*`$(el).innerHeight([height])`
@@ -203,6 +211,8 @@ The following example lets you change the different width properties used by `$(
[jQuery.formParams](http://donejs.com/docs.html#!jQuery.formParams) adds `$.fn.formParams` which serializes a form into a JavaScript object. It creates nested objects by using bracket notation in the form element name. If *convert* is `true`, values that look like numbers or booleans will be converted and empty strings won't be added to the object. For a form like this:
207
217
208
218
{% highlight html %}
@@ -239,6 +249,8 @@ Update the form in the following example to see a JSON representation of the obj
239
249
240
250
## range `$.Range([el]) -> range``$(el).range() -> range`
Use [jQuery.Range](http://donejs.com/docs.html#!jQuery.Range) to create, move and compare text ranges. Use `$.Range.current()` to get the currently selected text range. `$(el).range()` returns a text range on an element.
243
255
244
256
For example, for an element like `<div id="text">This is some text</div>`, `$.Range` can be used like this:
@@ -295,6 +307,8 @@ A `$.Range` instance offers the following methods:
[jQuery.selection](http://donejs.com/docs.html#!jQuery.selection) adds `$.fn.selection` to set or retrieve the currently selected text range. It works on all elements:
299
313
300
314
{% highlight html %}
@@ -315,6 +329,8 @@ The following example shows how `$.fn.selection` can be used. Initially the sele
[jQuery.styles](http://donejs.com/docs.html#!jQuery.styles) adds `$.fn.styles` as a fast way of getting a set of computed styles from an element. It performs much faster than retrieving them individually e.g. by using [jQuery.css()](http://api.jquery.com/css/). Computed styles reflect the actual current style of an element, including browser defaults and CSS settings.
319
335
320
336
{% highlight javascript %}
@@ -329,6 +345,8 @@ the runtime to the equivalent [jQuery.height](http://api.jquery.com/height/):
329
345
330
346
## within `$(el).within(left, top, [useOffsetCache]) -> jQuery`
[jQuery.within](http://donejs.com/docs.html#!jQuery.within) adds `$.fn.within` and `$.fn.withinBox` that return all elements having a given position or area in common. The following example returns all `div` elements having the point 200px left and 200px from the top in common:
333
351
334
352
{% highlight javascript %}
@@ -351,6 +369,8 @@ Move the mouse in the following example and it will show the ids for `div` eleme
The `destroyed` event is triggered by [jQuery.event.destroyed](http://donejs.com/docs.html#!jQuery.event.destroyed) when the element is removed from the DOM using one of the jQuery [manipulation methods](http://api.jquery.com/category/manipulation/).
[jQuery.event.key](http://donejs.com/docs.html#!jQuery.event.key) adds a `.keyName()` method to the event object that returns a string representation of the current key:
517
547
518
548
{% highlight javascript %}
@@ -562,6 +592,8 @@ The following example implements a `tabs` widget using [CanJS](http://canjs.us).
[jQuery.fn.triggerAsync](http://donejs.com/docs.html#!jQuery.fn.triggerAsync) triggers an event and calls a *success* handler when it has finished propagating through the DOM and no handler called `event.preventDefault()` or returned `false`. The *prevented* callback will be used otherwise:
[jQuery.even.default](http://donejs.com/docs.html#!jQuery.even.default) adds default event handlers. A default event runs when all other event handlers have been triggered and none has called `event.preventDefault()` or returned `false`. Default events are prefixed with the `default` namespace. The following example adds a default `toggle` event:
Pausing an event works similar to [.stopImmediatePropagation()](http://api.jquery.com/event.stopImmediatePropagation/) by calling `event.pause()`. Calling `event.resume()` will continue propagation. This is great when doing asynchronous processing in an event handler:
[jQuery.event.resize](http://donejs.com/docs.html#!jQuery.event.resize) allows you to listen to `resize` events on arbitrary elements. Unlike other events that bubble from the target element to the document the `resize` event will propagate from the outside-in.
609
647
This means that outside elements will always resize first. Trigger the `resize` event whenever the dimensions of an element change and inside elements should adjust as well.
610
648
@@ -625,6 +663,8 @@ The `resize` event makes creating application like layouts a lot easier. The fol
[jQuery.event.swipe](http://donejs.com/docs.html#!jQuery.event.swipe) adds support for swipe motions providing the *delegatable*`swipeleft`, `swiperight`, `swipedown`, `swipeup` and `swipe` events:
0 commit comments