X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=98825c3378637b89839d8240c7fb7188e5a7451c;hb=e2d3c4341908aa2a36023c91a8a684d10e93339a;hp=65732b8f7a0b9d7ccfa5e41d84cff7510081840d;hpb=6346e5d1c23108ff850d324904c274b273ea993e;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 65732b8..98825c3 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -127,9 +127,8 @@ if ( typeof $ != "undefined" ) * @before
one
two
three
* @result [two
] * - * @example $(document).ready( loaded ); - * @desc Executes the "loaded" function when the DOM is ready to - * be manipulated. + * @example $(document.body).background( "black" ); + * @desc Sets the background color of the page to black. * * @name $ * @param Element elem A DOM element to be encapsulated by a jQuery object. @@ -151,10 +150,15 @@ if ( typeof $ != "undefined" ) /** * A shorthand for $(document).ready(), allowing you to bind a function - * to be executed when the DOM document has finished loading. + * to be executed when the DOM document has finished loading. This function + * behaves just like $(document).ready(), in that it should be used to wrap + * all of the other $() operations on your page. While this function is, + * technically, chainable - there really isn't much use for chaining against it. * - * @example $( loaded ) - * @desc Executes the function "loaded" when the DOM is ready to be used. + * @example $(function(){ + * // Document is ready + * }); + * @desc Executes the function when the DOM is ready to be used. * * @name $ * @param Function fn The function to execute when the DOM is ready. @@ -163,11 +167,13 @@ if ( typeof $ != "undefined" ) */ /** - * A means of creating a duplicate copy of a jQuery object. + * A means of creating a cloned copy of a jQuery object. This function + * copies the set of matched elements from one jQuery object and creates + * another, new, jQuery object containing the same elements. * * @example var div = $("div"); - * $( div ).find("p") - * @desc Locates all p elements with all div elements, without disrupting the original jQuery object contained in 'div'. + * $( div ).find("p"); + * @desc Locates all p elements with all div elements, without disrupting the original jQuery object contained in 'div' (as would normally be the case if a simple div.find("p") was done). * * @name $ * @param jQuery obj The jQuery object to be cloned. @@ -343,14 +349,14 @@ jQuery.fn = jQuery.prototype = { * @result -1 * * @test ok( $([window, document]).index(window) == 0, "Check for index of elements" ); - * ok( $([window, document]).index(document) == 1, "Check for index of elements" ); - * var inputElements = $('#radio1,#radio2,#check1,#check2'); - * ok( inputElements.index(document.getElementById('radio1')) == 0, "Check for index of elements" ); - * ok( inputElements.index(document.getElementById('radio2')) == 1, "Check for index of elements" ); - * ok( inputElements.index(document.getElementById('check1')) == 2, "Check for index of elements" ); - * ok( inputElements.index(document.getElementById('check2')) == 3, "Check for index of elements" ); - * ok( inputElements.index(window) == -1, "Check for not found index" ); - * ok( inputElements.index(document) == -1, "Check for not found index" ); + * @test ok( $([window, document]).index(document) == 1, "Check for index of elements" ); + * @test var inputElements = $('#radio1,#radio2,#check1,#check2'); + * @test ok( inputElements.index(document.getElementById('radio1')) == 0, "Check for index of elements" ); + * @test ok( inputElements.index(document.getElementById('radio2')) == 1, "Check for index of elements" ); + * @test ok( inputElements.index(document.getElementById('check1')) == 2, "Check for index of elements" ); + * @test ok( inputElements.index(document.getElementById('check2')) == 3, "Check for index of elements" ); + * @test ok( inputElements.index(window) == -1, "Check for not found index" ); + * @test ok( inputElements.index(document) == -1, "Check for not found index" ); * * @name index * @type Number @@ -479,9 +485,9 @@ jQuery.fn = jQuery.prototype = { * @resultTest Paragraph.
* * @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); - * $('#foo').css({display: 'none'}); + * @test $('#foo').css({display: 'none'}); * ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); - * $('#foo').css({display: 'block'}); + * @test $('#foo').css({display: 'block'}); * ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); * * @name css @@ -498,9 +504,9 @@ jQuery.fn = jQuery.prototype = { * @resultTest Paragraph.
* * @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); - * $('#foo').css('display', 'none'); + * @test $('#foo').css('display', 'none'); * ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); - * $('#foo').css('display', 'block'); + * @test $('#foo').css('display', 'block'); * ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); * * @name css @@ -558,9 +564,9 @@ jQuery.fn = jQuery.prototype = { * @resultTest Paragraph.