diff options
Diffstat (limited to 'jquery.html.markdown')
-rw-r--r-- | jquery.html.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/jquery.html.markdown b/jquery.html.markdown index ffac93f8..d498733d 100644 --- a/jquery.html.markdown +++ b/jquery.html.markdown @@ -66,7 +66,7 @@ $('#btn').on( ); // You can move and hide elements with some effect methods -$('.table').hide(); # Hides the element(s) +$('.table').hide(); // Hides the element(s) // Note: calling a function in these methods will still hide the element $('.table').hide(function(){ @@ -104,13 +104,13 @@ tables.animate({margin-top:"+=50", height: "100px"}, 500, myFunction); // 3. Manipulation // These are similar to effects but can do more -$('div').addClass('div'); // Adds class div to all div taming-slim-20 +$('div').addClass('taming-slim-20'); // Adds class taming-slim-20 to all div // Common manipulation methods $('p').append('Hello world'); // Adds to end of element $('p').attr('class'); // Gets attribute $('p').attr('class', 'content'); // Sets attribute -$('p').hasClass('div'); // Returns true if it has the class +$('p').hasClass('taming-slim-20'); // Returns true if it has the class $('p').height(); // Gets height of element or sets height @@ -121,7 +121,7 @@ $('p').height(); // Gets only the first 'p' tag's height // You can use each to loop through all the elements var heights = []; $('p').each(function() { - heights.push($(this.height)); // Adds all 'p' tag heights to array + heights.push($(this).height()); // Adds all 'p' tag heights to array }); |