Where's the width() function in jQuery source?
Where's the width()
function in jQu开发者_如何学编程ery source?
Search for jQuery.each([ "Height", "Width" ], function( i, name ) {
in the code (around the end of the file).
The function is defined by the following statement, when name = "Width" in the outer function.
jQuery.fn[ type ] = function( size ) {
A convenient way to browse the jQuery source is using James Padolsey's interactive source viewer (unfortunately down as of this writing Update: Working again).
Actually the last function in the chain which is called for width calculation : getWidthOrHeight
At least in latest jquery code:
http://code.jquery.com/jquery-latest.js
精彩评论