offset: make sure there is a parent node to work on while calculating scroll offsets...
[jquery.git] / build / docs / gen-events.pl
1 #!/usr/bin/perl
2
3 my @stuff = split(",", "blur,focus,load,resize,scroll,unload,click,dblclick," .
4                 "mousedown,mouseup,mousemove,mouseover,mouseout,change,reset,select," .
5                 "submit,keydown,keypress,keyup,error");
6
7 foreach (@stuff) {
8
9 print qq~
10                 /**
11                  * Bind a function to the $_ event of each matched element.
12                  *
13                  * \@example \$("p").$_( function() { alert("Hello"); } );
14                  * \@before <p>Hello</p>
15                  * \@result <p on$_="alert('Hello');">Hello</p>
16                  *
17                  * \@name $_
18                  * \@type jQuery
19                  * \@param Function fn A function to bind to the $_ event on each of the matched elements.
20                  * \@cat Events
21                  */
22
23                 /**
24                  * Trigger the $_ event of each matched element. This causes all of the functions
25                  * that have been bound to thet $_ event to be executed.
26                  *
27                  * \@example \$("p").$_();
28                  * \@before <p on$_="alert('Hello');">Hello</p>
29                  * \@result alert('Hello');
30                  *
31                  * \@name $_
32                  * \@type jQuery
33                  * \@cat Events
34                  */
35
36                 /**
37                  * Bind a function to the $_ event of each matched element, which will only be executed once.
38                  * Unlike a call to the normal .$_() method, calling .one$_() causes the bound function to be
39                  * only executed the first time it is triggered, and never again (unless it is re-bound).
40                  *
41                  * \@example \$("p").one$_( function() { alert("Hello"); } );
42                  * \@before <p on$_="alert('Hello');">Hello</p>
43                  * \@result alert('Hello'); // Only executed for the first $_
44                  *
45                  * \@name one$_
46                  * \@type jQuery
47                  * \@param Function fn A function to bind to the $_ event on each of the matched elements.
48                  * \@cat Events
49                  */
50
51                 /**
52                  * Removes a bound $_ event from each of the matched
53                  * elements. You must pass the identical function that was used in the original 
54                  * bind method.
55                  *
56                  * \@example \$("p").un$_( myFunction );
57                  * \@before <p on$_="myFunction">Hello</p>
58                  * \@result <p>Hello</p>
59                  *
60                  * \@name un$_
61                  * \@type jQuery
62                  * \@param Function fn A function to unbind from the $_ event on each of the matched elements.
63                  * \@cat Events
64                  */
65
66                 /**
67                  * Removes all bound $_ events from each of the matched elements.
68                  *
69                  * \@example \$("p").un$_();
70                  * \@before <p on$_="alert('Hello');">Hello</p>
71                  * \@result <p>Hello</p>
72                  *
73                  * \@name un$_
74                  * \@type jQuery
75                  * \@cat Events
76                  */
77 ~;
78
79
80 }