Skip to content

Commit d1e2970

Browse files
committed
Adding annotated source
1 parent bc776de commit d1e2970

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

index.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ require.config({
110110

111111
## animate `$(el).animate(properties, [speed], [callback]) -> jQuery`
112112

113+
[Annotated source](http://donejs.com/jquery/docs/jquery.animate.html)
114+
113115
[jQuery.animate](http://donejs.com/docs.html#!jQuery.animate) overwrites `$.fn.animate` to use
114116
CSS 3 animations if possible.
115117
It takes the same arguments as the original [$.fn.animate](http://api.jquery.com/animate) and will fall back to
@@ -131,6 +133,8 @@ Since CSS transitions are implemented natively in the browser and can make use o
131133

132134
## compare `$(elA).compare(elB) -> Number`
133135

136+
[Annotated source](http://donejs.com/jquery/docs/jquery.compare.html)
137+
134138
[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'))`:
135139

136140
* `000000` -> __0__: Elements are identical
@@ -154,6 +158,8 @@ This is useful to rapidly compare element positions which is common when widgets
154158

155159
## cookie `$.cookie(name, [value], [options]) -> Object|String`
156160

161+
[Annotated source](http://donejs.com/jquery/docs/jquery.cookie.html)
162+
157163
[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:
158164

159165
{% highlight javascript %}
@@ -177,10 +183,12 @@ The example uses `jQuery.cookie` and [formParams](#formParams) to persist a form
177183
or load it from the value stored in the cookie. At the bottom it shows the current cookie value after running it through
178184
`decodeURIComponent`:
179185

180-
<iframe style="width: 100%; height: 500px" src="http://jsfiddle.net/wMN7G/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0">JSFiddle</iframe>
186+
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/wMN7G/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0">JSFiddle</iframe>
181187

182188
## dimensions
183189

190+
[Annotated source](http://donejs.com/jquery/docs/jquery.dimensions.html)
191+
184192
[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:
185193

186194
* `$(el).innerHeight([height])`
@@ -203,6 +211,8 @@ The following example lets you change the different width properties used by `$(
203211

204212
## formParams `$(form).formParams([convert]) -> Object|jQuery`
205213

214+
[Annotated source](http://donejs.com/jquery/docs/jquery.form_params.html)
215+
206216
[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:
207217

208218
{% highlight html %}
@@ -239,6 +249,8 @@ Update the form in the following example to see a JSON representation of the obj
239249

240250
## range `$.Range([el]) -> range` `$(el).range() -> range`
241251

252+
[Annotated source](http://donejs.com/jquery/docs/jquery.range.html)
253+
242254
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.
243255

244256
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:
295307

296308
## selection `$(el).selection([start], [end]) -> Object|jQuery`
297309

310+
[Annotated source](http://donejs.com/jquery/docs/jquery.selection.html)
311+
298312
[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:
299313

300314
{% highlight html %}
@@ -315,6 +329,8 @@ The following example shows how `$.fn.selection` can be used. Initially the sele
315329

316330
## styles `$(el).styles() -> Object`
317331

332+
[Annotated source](http://donejs.com/jquery/docs/jquery.styles.html)
333+
318334
[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.
319335

320336
{% highlight javascript %}
@@ -329,6 +345,8 @@ the runtime to the equivalent [jQuery.height](http://api.jquery.com/height/):
329345

330346
## within `$(el).within(left, top, [useOffsetCache]) -> jQuery`
331347

348+
[Annotated source](http://donejs.com/jquery/docs/jquery.within.html)
349+
332350
[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:
333351

334352
{% highlight javascript %}
@@ -351,6 +369,8 @@ Move the mouse in the following example and it will show the ids for `div` eleme
351369

352370
## destroyed `destroyed`
353371

372+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.destroyed.html)
373+
354374
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/).
355375

356376
{% highlight javascript %}
@@ -363,6 +383,8 @@ $('form').on('destroyed', function() {
363383

364384
## drag `dragdown` `draginit` `dragmove` `dragend` `dragover` `dragout`
365385

386+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.drag.html)
387+
366388
[jQuery.event.drag](http://donejs.com/docs.html#!jQuery.event.drag) adds *delegatable* drag events to jQuery:
367389

368390
* `dragdown` - the mouse cursor is pressed down
@@ -422,6 +444,8 @@ The `drag` object (passed to the event handler as the second parameter) can be u
422444

423445
## drop `dropinit` `dropover` `dropout` `dropmove` `dropon` `dropend`
424446

447+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.drop.html)
448+
425449
[jQuery.event.drop](http://donejs.com/docs.html#!jQuery.event.drop) complements `jQuery.event.drag` with *delegatable* drop events:
426450

427451
* `dropinit` - the drag motion is started, drop positions are calculated
@@ -463,6 +487,8 @@ The following example shows two draggable elements and a drop area. When a drag
463487

464488
## fastfix
465489

490+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.fastfix.html)
491+
466492
[jQuery.event.fastfix](http://donejs.com/docs.html#!jQuery.event.fastfix) speeds up `jQuery.event.fix` by using ECMAScript 5
467493
getters. `jQuery.event.fix` is used to normalize a DOM event before it gets passed as a
468494
[jQuery.Event](http://api.jquery.com/category/events/event-object/) instance to event handlers. This is usually done by
@@ -477,6 +503,8 @@ performance](http://jsperf.com/jquery-event-fix/6) of the original `jQuery.event
477503

478504
## hover `hoverinit` `hoverenter` `hovermove` `hoverleave`
479505

506+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.hover.html)
507+
480508
[jQuery.event.hover](http://donejs.com/docs.html#!jQuery.event.hover) provides the following hover events:
481509

482510
* `hoverinit` - called on mouseenter
@@ -513,6 +541,8 @@ The following example shows `jQuery.event.hover` with different settings for dis
513541

514542
## key `event.keyName()`
515543

544+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.key.html)
545+
516546
[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:
517547

518548
{% highlight javascript %}
@@ -562,6 +592,8 @@ The following example implements a `tabs` widget using [CanJS](http://canjs.us).
562592

563593
### triggerAsync `$(el).triggerAsync(event, [success], [prevented])`
564594

595+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.default.html)
596+
565597
[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:
566598

567599
{% highlight javascript %}
@@ -574,6 +606,8 @@ $('panel').triggerAsync('show', function(){
574606

575607
### default events `eventname.default`
576608

609+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.default.html)
610+
577611
[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:
578612

579613
{% highlight javascript %}
@@ -591,6 +625,8 @@ $('#text').on('toggle', function(ev, animation) {
591625

592626
### pause and resume `event.pause()` `event.resume()`
593627

628+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.pause.html)
629+
594630
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:
595631

596632
{% highlight javascript %}
@@ -605,6 +641,8 @@ $('#todos').on('show', function(ev){
605641

606642
## resize `resize`
607643

644+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.resize.html)
645+
608646
[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.
609647
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.
610648

@@ -625,6 +663,8 @@ The `resize` event makes creating application like layouts a lot easier. The fol
625663

626664
## swipe `swipeleft` `swiperight` `swipeup` `swipedown` `swipe`
627665

666+
[Annotated source](http://donejs.com/jquery/docs/jquery.event.swipe.html)
667+
628668
[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:
629669

630670
{% highlight javascript %}

0 commit comments

Comments
 (0)