Permalink
Browse files

Update README.

  • Loading branch information...
1 parent a46c9ba commit 20224e19ae59f4606ba6614ff95abde6659a5829 @lukemorton committed Oct 14, 2011
Showing with 26 additions and 18 deletions.
  1. +26 −18 README.markdown
View
@@ -5,35 +5,43 @@ now Bind Bonuses they are!
## The methods
-### $.fn.bindStop( eventType, [ eventData ], handler(eventObject), [ delay ] )
+### $.fn.bindStop( eventType [, eventData], handler(eventObject) [, delay] )
This method waits until `delay` ms after the last occurance of
event, then calls the callback. So if you are continously typing
only after you have stopped for the defined `delay` will the
handler be called.
- // Only search 1.5 seconds after user stops typing
- $('input[name=search]').bindStop('keydown', function (e) {
- $.get('search', {"search": $(this).val()}, function (res) {
- $('#results').html(res);
- });
- }, 1500);
+```javascript
+// Only search 1.5 seconds after user stops typing
+$('input[name=search]').bindStop('keydown', function (e) {
+ $.get('search', {"search": $(this).val()}, function (res) {
+ $('#results').html(res);
+ });
+}, 1500);
+```
-### $.fn.bindThrottle( eventType, [ eventData ], handler(eventObject), [ delay ] )
+### $.fn.bindThrottle( eventType [, eventData], handler(eventObject) [, delay] )
This method only calls a callback if the event hasn't been
called in the last `delay` ms. If it has been called it waits
until after the throttle time to call it.
- // Check password security every 400 milliseconds of typing
- $('input[name=search]').bindThrottle('keydown', function (e) {
- if (passwordSecure($(this).val())) {
- $('#result').html('<p>Password is secure</p>');
- } else {
- $('#result').html('<p>Password is <em>not</em> secure</p>');
- }
- });
+```javascript
+// Check password security every 500 milliseconds of typing
+$('input[name=search]').bindThrottle('keydown', function (e) {
+ if (passwordSecure($(this).val())) {
+ $('#result').html('<p>Password is secure</p>');
+ } else {
+ $('#result').html('<p>Password is <em>not</em> secure</p>');
+ }
+}, 500);
+```
+
+## Author
+
+Luke Morton
+## License
-Peace xx
-Luke
+MIT

0 comments on commit 20224e1

Please sign in to comment.