|
4 | 4 | <meta charset="iso-8859-1"> |
5 | 5 | <title>Testing mousewheel plugin</title> |
6 | 6 |
|
7 | | - <script> |
8 | | - (function() { |
9 | | - var verMatch = /v=([\w\.]+)/.exec(location.search), |
10 | | - version = verMatch && verMatch[1], |
11 | | - src; |
12 | | - if (version) |
13 | | - src = 'code.jquery.com/jquery-' + version; |
14 | | - else |
15 | | - src = 'code.jquery.com/jquery-git'; |
16 | | - document.write('<script src="http://' + src + '.js"><\/script>'); |
17 | | - })(); |
18 | | - </script> |
19 | | - <script src="../jquery.mousewheel.js"></script> |
20 | | - |
21 | 7 | <style> |
22 | 8 | html { |
23 | 9 | font: 13px Arial, sans-serif; |
24 | 10 | } |
25 | 11 |
|
26 | 12 | #stage { |
| 13 | + color: #fff; |
27 | 14 | position: relative; |
28 | 15 | zoom: 1; |
29 | 16 | } |
30 | 17 |
|
| 18 | + #test1, #test2, #test3, #test4, #test5, #test6, #test7 { |
| 19 | + float: left; |
| 20 | + } |
| 21 | + |
31 | 22 | #test1 { |
32 | 23 | background-color: #000; |
33 | 24 | width: 120px; |
34 | 25 | height: 100px; |
35 | | - color: #fff; |
36 | | - float: left; |
37 | 26 | } |
38 | 27 |
|
39 | 28 | #test2 { |
40 | 29 | background-color: #333; |
41 | 30 | width: 120px; |
42 | 31 | height: 100px; |
43 | | - color: #fff; |
44 | | - float: left; |
45 | 32 | } |
46 | 33 |
|
47 | 34 | #test3 { |
48 | 35 | background-color: #666; |
49 | 36 | width: 120px; |
50 | 37 | height: 100px; |
51 | | - color: #fff; |
52 | | - float: left; |
53 | 38 | } |
54 | 39 |
|
55 | 40 | #test4 { |
56 | 41 | background-color: #000; |
57 | 42 | width: 120px; |
58 | 43 | height: 100px; |
59 | | - color: #fff; |
60 | | - float: left; |
61 | 44 | } |
62 | 45 |
|
63 | 46 | #test5 { |
64 | 47 | background-color: #333; |
65 | 48 | padding: 5px; |
66 | 49 | width: 400px; |
67 | 50 | height: 400px; |
68 | | - color: #fff; |
69 | | - float: left; |
70 | 51 | } |
71 | 52 |
|
72 | 53 | #test6 { |
73 | 54 | background-color: #666; |
74 | 55 | padding: 5px; |
75 | 56 | width: 250px; |
76 | 57 | height: 250px; |
77 | | - color: #fff; |
78 | | - float: left; |
79 | 58 | } |
80 | 59 |
|
81 | 60 | #test7 { |
82 | 61 | background-color: #000; |
83 | 62 | padding: 5px; |
84 | 63 | width: 100px; |
85 | 64 | height: 100px; |
86 | | - color: #fff; |
87 | | - float: left; |
88 | 65 | } |
89 | 66 |
|
90 | 67 | #forceScroll { |
|
103 | 80 | } |
104 | 81 |
|
105 | 82 | #logger p { |
| 83 | + color: #000; |
106 | 84 | padding: 2px; |
107 | 85 | border-bottom: 1px solid #ccc; |
108 | 86 | margin: 0; |
|
116 | 94 | border-bottom-color: #000; |
117 | 95 | } |
118 | 96 | </style> |
| 97 | + |
| 98 | + <script> |
| 99 | + (function() { |
| 100 | + var verMatch = /v=([\w\.]+)/.exec(location.search), |
| 101 | + version = verMatch && verMatch[1], |
| 102 | + src; |
| 103 | + if (version) |
| 104 | + src = 'code.jquery.com/jquery-' + version; |
| 105 | + else |
| 106 | + src = 'code.jquery.com/jquery-git'; |
| 107 | + document.write('<script src="http://' + src + '.js"><\/script>'); |
| 108 | + })(); |
| 109 | + </script> |
119 | 110 | <script> |
120 | 111 | $(function() { |
121 | 112 | $('#userAgent').html(navigator.userAgent); |
|
147 | 138 | }; |
148 | 139 |
|
149 | 140 | $('#test1') |
150 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 141 | + .mousewheel(function(event, delta) { |
151 | 142 | loghandle(event, delta); |
152 | 143 | log('pageX: ' + event.pageX + ' pageY: ' + event.pageY ); |
153 | 144 | }); |
154 | 145 |
|
155 | 146 | $('#test2') |
156 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 147 | + .mousewheel(function(event, delta) { |
157 | 148 | loghandle(event, delta); |
158 | 149 | return false; // prevent default |
159 | 150 | }); |
|
170 | 161 | }; |
171 | 162 |
|
172 | 163 | $('#test4') |
173 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 164 | + .mousewheel(function(event, delta) { |
174 | 165 | loghandle(event, delta); |
175 | 166 | return false; |
176 | 167 | }) |
177 | 168 | .mousewheel(testRemoval) |
178 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 169 | + .mousewheel(function(event, delta) { |
179 | 170 | loghandle(event, delta); |
180 | 171 | return false; |
181 | 172 | }) |
182 | 173 | .unmousewheel(testRemoval); |
183 | 174 |
|
184 | 175 | $('#test5') |
185 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 176 | + .mousewheel(function(event, delta) { |
186 | 177 | loghandle(event, delta); |
187 | 178 | event.stopPropagation(); |
188 | 179 | event.preventDefault(); |
189 | 180 | }); |
190 | 181 |
|
191 | 182 | $('#test6') |
192 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 183 | + .mousewheel(function(event, delta) { |
193 | 184 | loghandle(event, delta); |
194 | 185 | event.stopPropagation(); |
195 | 186 | event.preventDefault(); |
196 | 187 | }); |
197 | 188 |
|
198 | 189 | $('#test7') |
199 | | - .mousewheel(function(event, delta, deltaX, deltaY) { |
| 190 | + .mousewheel(function(event, delta) { |
200 | 191 | loghandle(event, delta); |
201 | 192 | event.preventDefault(); |
202 | 193 | }); |
|
206 | 197 | } |
207 | 198 | }); |
208 | 199 | </script> |
| 200 | + <script src="../jquery.mousewheel.js"></script> |
209 | 201 | </head> |
210 | 202 | <body> |
211 | 203 | <h1 id="banner">jQuery mousewheel.js Test with jQuery <span id="jqueryVersion"></span></h1> |
|
0 commit comments