Skip to content
This repository
Browse code

fix semicolons in README

  • Loading branch information...
commit 41fe2cd909334d25100fe9753e76557dac6bd379 1 parent 353e9db
Thomas Fuchs authored

Showing 1 changed file with 31 additions and 31 deletions. Show diff stats Hide diff stats

  1. +31 31 README.md
62 README.md
Source Rendered
@@ -31,7 +31,7 @@ In short, Zepto is expected to work in every modern browser except Internet Expl
31 31 Basic call with CSS selector:
32 32
33 33 ``` js
34   -$('p>span').html('yoho').css({color: 'red'});
  34 +$('p>span').html('yoho').css({color: 'red'})
35 35 ```
36 36
37 37 Instead of a selector, a DOM Element, or a list of nodes can be passed in.
@@ -42,8 +42,8 @@ The $ function takes an optional context argument, which can be a DOM Element or
42 42 $('span', $('p')) // -> find all <span> elements in <p> elements
43 43
44 44 $('p').bind('click', function(){
45   - $('span', this).css({color: 'red'}); // affects "span" children/grandchildren
46   -});
  45 + $('span', this).css({color: 'red'}) // affects "span" children/grandchildren
  46 +})
47 47 ```
48 48
49 49 Context and .find calls are equivalent:
@@ -77,12 +77,12 @@ prev() // previous siblings
77 77 filter('selector') // reduce the current set of elements to match the given selector
78 78 is('selector') // returns true/false if first element matches the selector
79 79 not('selector') // remove elements matching 'selector' from the current collection
80   -not(function(index){return true / false;}) // remove elements from current collection if the callback method returns `true`
  80 +not(function(index){return true / false}) // remove elements from current collection if the callback method returns `true`
81 81
82 82 remove() // remove element
83 83
84 84 html('new html') // set the contents of the element(s)
85   -html(function(index, oldhtml){ return ...; }) // set the contents of the element(s) from a method
  85 +html(function(index, oldhtml){ return ... }) // set the contents of the element(s) from a method
86 86
87 87 html() // get first element's .innerHTML
88 88 text() // get first element's .textContent
@@ -99,7 +99,7 @@ width() // get first elements width in px, including padding and border (equival
99 99
100 100 attr('attribute') // get element attribute
101 101 attr('attribute', 'value') // set element attribute
102   -attr('attribute', function(index, oldAttr){ return ...; }) // set the value of 'attribute' from a method, for each element in collection
  102 +attr('attribute', function(index, oldAttr){ return ... }) // set the value of 'attribute' from a method, for each element in collection
103 103 removeAttr('attribute') // removes an attribute
104 104 data('name') // gets the value of the "data-name" attribute
105 105 data('name', 'value') // sets the value of the "data-name" attribute
@@ -109,12 +109,12 @@ css({ property1: value1, property2: value2 }) // set multiple CSS properties
109 109 css('css property') // get this CSS property of the first element, looks at both .style object properties and the computed style
110 110
111 111 addClass('classname') // adds a CSS class name
112   -addClass(function(index, existingClasses){ return ...; }) // adds a CSS class name from a method
  112 +addClass(function(index, existingClasses){ return ... }) // adds a CSS class name from a method
113 113 removeClass('classname') // removes a CSS class name
114   -removeClass(function(index, existingClasses){ return ...; }) // removes a CSS class name from a method
  114 +removeClass(function(index, existingClasses){ return ... }) // removes a CSS class name from a method
115 115 hasClass('classname') // returns true of first element has a classname set
116 116 toggleClass('classname'[, switch]) // adds/removes class, or adds/removes it when switch == true/false
117   -toggleClass(function(index, existingClasses){ return ...; }) // adds/removes class from a method
  117 +toggleClass(function(index, existingClasses){ return ... }) // adds/removes class from a method
118 118
119 119 on(type, [selector,] function) // add event listener to elements
120 120 off(type, [selector,] function) // remove event listener from elements
@@ -152,8 +152,8 @@ pluck(property)
152 152 # Utility functions:
153 153
154 154 ``` js
155   -$(document).ready(function(){ ... }); // call function after DOM is ready to use (before load event fires)
156   -$.isFunction(function), $.isObject(object), $.isArray(array); // returns true if given parameter is a function; an object; or an array, respectively
  155 +$(document).ready(function(){ ... }) // call function after DOM is ready to use (before load event fires)
  156 +$.isFunction(function), $.isObject(object), $.isArray(array) // returns true if given parameter is a function; an object; or an array, respectively
157 157 $.extend(target, object1 [,objectN]) // extends (merge) the target object with additional objects. Modifies and returns target
158 158 ```
159 159
@@ -162,43 +162,43 @@ $.extend(target, object1 [,objectN]) // extends (merge) the target object with a
162 162 Adding an event listener:
163 163
164 164 ``` js
165   -$('some selector').bind('click', function(event){ ... });
  165 +$('some selector').bind('click', function(event){ ... })
166 166 ```
167 167
168 168 Adding an event listener on multiple events:
169 169
170 170 ``` js
171   -$('some selector').bind('touchstart touchmove touchend', function(event){ ... });
  171 +$('some selector').bind('touchstart touchmove touchend', function(event){ ... })
172 172 ```
173 173
174 174 Adding one event listener that uses event delegation to be only active on a range of children/grandchildren (as given with the subselector):
175 175
176 176 ``` js
177   -$('some selector').delegate('some subselector', 'touchstart', function(event){ alert("I'm touched!") });
  177 +$('some selector').delegate('some subselector', 'touchstart', function(event){ alert("I'm touched!") })
178 178 ```
179 179
180 180 Adding a "live" event listener, that fires on all elements that match the selector now and in the future:
181 181
182 182 ``` js
183   -$('p.yay').live('click', function(){ alert("Clicked a p.yay element!") });
  183 +$('p.yay').live('click', function(){ alert("Clicked a p.yay element!") })
184 184 ```
185 185
186 186 Removing an event listener:
187 187
188 188 ``` js
189   -$('some selector').unbind('click', listener);
  189 +$('some selector').unbind('click', listener)
190 190 ```
191 191
192 192 Removing all event listeners for a particular event:
193 193
194 194 ``` js
195   -$('some selector').unbind('click');
  195 +$('some selector').unbind('click')
196 196 ```
197 197
198 198 Removing all event listeners:
199 199
200 200 ``` js
201   -$('some selector').unbind();
  201 +$('some selector').unbind()
202 202 ```
203 203
204 204 # Touch events
@@ -208,7 +208,7 @@ Zepto has several extensions over the jQuery API to make it easy to react to tou
208 208 Tapping:
209 209
210 210 ``` js
211   -$('some selector').tap(function(){ ... });
  211 +$('some selector').tap(function(){ ... })
212 212 ```
213 213
214 214 Single Tap:
@@ -218,61 +218,61 @@ ms buffer to be able to differentiate between a single tap and a double tap. Don
218 218 using "doubleTap" since it will cause a 250 ms delay, which could lead to a bad user experience.
219 219
220 220 ``` js
221   -$('some selector').singleTap(function(){ ... });
  221 +$('some selector').singleTap(function(){ ... })
222 222 ```
223 223
224 224 Double-tapping:
225 225
226 226 ``` js
227   -$('some selector').doubleTap(function(){ ... });
  227 +$('some selector').doubleTap(function(){ ... })
228 228 ```
229 229
230 230 Swiping (e.g. "delete" button when swiping over a list entry):
231 231
232 232 ``` js
233   -$('some selector').swipe(function(){ ... });
  233 +$('some selector').swipe(function(){ ... })
234 234 ```
235 235
236 236 Swiping left:
237 237
238 238 ``` js
239   -$('some selector').swipeLeft(function(){ ... });
  239 +$('some selector').swipeLeft(function(){ ... })
240 240 ```
241 241
242 242 Swiping right:
243 243
244 244 ``` js
245   -$('some selector').swipeRight(function(){ ... });
  245 +$('some selector').swipeRight(function(){ ... })
246 246 ```
247 247
248 248 Swiping up:
249 249
250 250 ``` js
251   -$('some selector').swipeUp(function(){ ... });
  251 +$('some selector').swipeUp(function(){ ... })
252 252 ```
253 253
254 254 Swiping down:
255 255
256 256 ``` js
257   -$('some selector').swipeDown(function(){ ... });
  257 +$('some selector').swipeDown(function(){ ... })
258 258 ```
259 259
260 260 Pinch (iOS only):
261 261
262 262 ``` js
263   -$('some selector').pinch(function(){ ... });
  263 +$('some selector').pinch(function(){ ... })
264 264 ```
265 265
266 266 Pinch in (iOS only):
267 267
268 268 ``` js
269   -$('some selector').pinchIn(function(){ ... });
  269 +$('some selector').pinchIn(function(){ ... })
270 270 ```
271 271
272 272 Pinch out (iOS only):
273 273
274 274 ``` js
275   -$('some selector').pinchOut(function(){ ... });
  275 +$('some selector').pinchOut(function(){ ... })
276 276 ```
277 277
278 278 # Ajax
@@ -304,8 +304,8 @@ $.ajax({
304 304 Loading content into an element:
305 305
306 306 ``` js
307   -$('selector').load('url'[, callback]);
308   -$('selector').load('url #fragment-selector'[, callback]);
  307 +$('selector').load('url'[, callback])
  308 +$('selector').load('url #fragment-selector'[, callback])
309 309 ```
310 310
311 311 # Environmental information

0 comments on commit 41fe2cd

Please sign in to comment.
Something went wrong with that request. Please try again.