3 <script src='../dist/jquery.js' type='text/javascript'></script>
\r
6 background-color: red;
\r
7 border: solid 3px red;
\r
12 <h2>Change Tests</h2>
\r
19 <select class='select_test'>
\r
20 <option value='one'>change me 1</option>
\r
21 <option value='two'>change me 2</option>
\r
22 <option value='three'>change me 3</option>
\r
24 <select class='select_test'>
\r
25 <option value='one'>change me 1</option>
\r
26 <option value='two' selected="selected">change me 2</option>
\r
27 <option value='three'>change me 3</option>
\r
31 <select class='mselect_test' multiple="multiple">
\r
32 <option value='one'>change me 1</option>
\r
33 <option value='two'>change me 2</option>
\r
34 <option value='three'>change me 3</option>
\r
38 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox1"/>
\r
39 <label for="checkbox1">Checkbox 1</label><br/>
\r
40 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox2"/>
\r
41 <label for="checkbox2">Checkbox 2</label>
\r
42 <input type="checkbox" class="checkbox_test" name="mycheckbox" id="checkbox3" disabled="disabled"/>
\r
43 <label for="checkbox3">Checkbox 3</label>
\r
48 <input type="radio" class="radio_test" name="myradio" id="radio1"/>
\r
49 <label for="radio1">Radio1</label><br/>
\r
50 <input type="radio" class="radio_test" name="myradio" id="radio2"/>
\r
51 <label for="radio2">Radio2</label>
\r
52 <input type="radio" class="radio_test" name="myradio" id="radio3" disabled="disabled"/>
\r
53 <label for="radio3">Radio3</label>
\r
56 <input class="file_test" id="file1" type="file"/>
\r
58 <input class='test' value='' id='input' size='10' />
\r
59 <input class='test' value='test' id='input2' size='10' readonly="readonly" />
\r
62 <textarea rows='2'></textarea>
\r
64 <td>$(document).bind('change')</td>
\r
68 <td id='select' class="red">SELECT</td>
\r
69 <td id='mselect' class="red">MULTI</td>
\r
70 <td id='checkbox' class="red">CHECKBOX</td>
\r
71 <td id='radio' class="red">RADIO</td>
\r
72 <td id='file' class="red">FILE</td>
\r
73 <td id='text' class="red">TEXT</td>
\r
74 <td id='textarea' class="red">TEXTAREA</td>
\r
75 <td id='boundChange' class="red">DOCUMENT</td>
\r
79 <td id='selectbind' class="red">SELECT</td>
\r
80 <td id='mselectbind' class="red">MULTI</td>
\r
81 <td id='checkboxbind' class="red">CHECKBOX</td>
\r
82 <td id='radiobind' class="red">RADIO</td>
\r
83 <td id='filebind' class="red">FILE</td>
\r
84 <td id='textbind' class="red">TEXT</td>
\r
85 <td id='textareabind' class="red">TEXTAREA</td>
\r
89 <td id='selectfocus' class="red">SELECT</td>
\r
90 <td id='mselectfocus' class="red">MULTI</td>
\r
91 <td id='checkboxfocus' class="red">CHECKBOX</td>
\r
92 <td id='radiofocus' class="red">RADIO</td>
\r
93 <td id='filefocus' class="red">FILE</td>
\r
94 <td id='textfocus' class="red">TEXT</td>
\r
95 <td id='textareafocus' class="red">TEXTAREA</td>
\r
96 <td id='boundFocus' class="red">DOCUMENT</td>
\r
100 <td id='selectblur' class="red">SELECT</td>
\r
101 <td id='mselectblur' class="red">MULTI</td>
\r
102 <td id='checkboxblur' class="red">CHECKBOX</td>
\r
103 <td id='radioblur' class="red">RADIO</td>
\r
104 <td id='fileblur' class="red">FILE</td>
\r
105 <td id='textblur' class="red">TEXT</td>
\r
106 <td id='textareablur' class="red">TEXTAREA</td>
\r
107 <td id='boundBlur' class="red">DOCUMENT</td>
\r
110 <td>Live Focus:</td>
\r
111 <td id='selectlfocus' class="red">SELECT</td>
\r
112 <td id='mselectlfocus' class="red">MULTI</td>
\r
113 <td id='checkboxlfocus' class="red">CHECKBOX</td>
\r
114 <td id='radiolfocus' class="red">RADIO</td>
\r
115 <td id='filelfocus' class="red">FILE</td>
\r
116 <td id='textlfocus' class="red">TEXT</td>
\r
117 <td id='textarealfocus' class="red">TEXTAREA</td>
\r
120 <td>Live Blur:</td>
\r
121 <td id='selectlblur' class="red">SELECT</td>
\r
122 <td id='mselectlblur' class="red">MULTI</td>
\r
123 <td id='checkboxlblur' class="red">CHECKBOX</td>
\r
124 <td id='radiolblur' class="red">RADIO</td>
\r
125 <td id='filelblur' class="red">FILE</td>
\r
126 <td id='textlblur' class="red">TEXT</td>
\r
127 <td id='textarealblur' class="red">TEXTAREA</td>
\r
130 <h2>Submit Tests</h2>
\r
137 <form action="" id="text_submit">
\r
138 <input class='test' type='text' value='Key Return To Submit'/>
\r
142 <form action="" id="password_submit">
\r
143 <input class='test' type='password' value=''/>
\r
147 <form action="" id="submit_submit">
\r
148 <input type='submit' value="Click Me To Submit" />
\r
151 <td>$(document).bind('submit')</td>
\r
155 <td id='textSubmit' class="red">TEXT</td>
\r
156 <td id='passwordSubmit' class="red">PASSWORD</td>
\r
157 <td id='submitSubmit' class="red">BUTTON</td>
\r
158 <td id='boundSubmit' class="red">DOCUMENT</td>
\r
164 <script type='text/javascript'>
\r
165 jQuery.fn.addChangeTest = function( id, prevent ) {
\r
166 this.bind("focusin", function(){
\r
167 jQuery(id + "focus").blink();
\r
168 }).bind("focusout", function(){
\r
169 jQuery(id + "blur").blink();
\r
172 this.bind("focus", function(){
\r
173 jQuery(id + "lfocus").blink();
\r
174 }).bind("blur", function(){
\r
175 jQuery(id + "lblur").blink();
\r
178 return this.bind("change", function(e){
\r
179 jQuery(id + "bind").blink();
\r
180 }).live("change", function(e){
\r
182 e.preventDefault();
\r
185 jQuery(id).blink();
\r
189 jQuery.fn.addSubmitTest = function( id, prevent ) {
\r
190 return this.live("submit", function(e){
\r
192 e.preventDefault();
\r
195 jQuery(id).blink();
\r
199 jQuery.fn.blink = function(){
\r
200 return this.css("backgroundColor","green").css("border","solid 3px green").delay(700).queue(function(next){
\r
201 jQuery(this).css("backgroundColor","");
\r
206 $(document).bind("focusin", function() {
\r
207 jQuery("#boundFocus").blink();
\r
210 $(document).bind("focusout", function() {
\r
211 jQuery("#boundBlur").blink();
\r
214 $("td.red").live("hover", function(e) {
\r
215 if ( e.type === "mouseenter" ) {
\r
216 $(this).css("backgroundColor","green");
\r
218 $(this).css("backgroundColor","");
\r
222 $(".select_test").addChangeTest("#select");
\r
223 $(".mselect_test").addChangeTest("#mselect");
\r
224 $(".checkbox_test").addChangeTest("#checkbox");
\r
225 $(".radio_test").addChangeTest("#radio");
\r
226 $(".file_test").addChangeTest("#file");
\r
227 $('textarea').addChangeTest("#textarea");
\r
228 $('#input').addChangeTest("#text");
\r
229 $(document).bind("change", function(){
\r
230 jQuery("#boundChange").blink();
\r
233 $("#text_submit").addSubmitTest("#textSubmit", true);
\r
234 $("#password_submit").addSubmitTest("#passwordSubmit", true);
\r
235 $("#submit_submit").addSubmitTest("#submitSubmit", true);
\r
236 $(document).bind("submit", function(){
\r
237 jQuery("#boundSubmit").blink();
\r