Changeset 7867 for extensions/Autosize/js/jquery.dimensions.js
- Timestamp:
- Nov 24, 2010, 12:42:36 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/js/jquery.dimensions.js
r7816 r7867 1 1 /* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) 2 3 4 5 6 7 8 9 10 11 12 13 14 2 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 * 5 * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $ 6 * $Rev: 4257 $ 7 * 8 * $LastChangedDate: 2010-10-23 08:43:48 -0600 (Thu, 20 Dec 2007) $ 9 * By cljosse 10 * Version: 1.2 11 * 12 * Requires: jQuery 1.2+ 13 * 14 */ 15 15 (function (jQuery) { 16 16 jQuery.dimensions = { version: '1.3' }; … … 64 64 65 65 66 var left = 0, top = 0, offset, parentOffset, offsetParent, results;66 var Left = 0, Top = 0, offset, parentOffset, offsetParent, results; 67 67 var borderwidth = { width: "0 0 0 0", 68 68 top: 0, … … 84 84 }; 85 85 //===================================================================== 86 myposition = ""; 86 87 results = { 87 position: jQuery(this).attr("position"),88 position: "", 88 89 top: 0, 89 90 left: 0, … … 102 103 if (elem.nodeName) nodeName = elem.nodeName; 103 104 105 104 106 if (elem == window) { 105 Position = { top: 0, left: 0 }; 106 } else { 107 Position = jQuery(elem).position(); 108 } 109 left = Position.left; 110 top = Position.top; 111 if (elem == window) { 107 108 myposition = jQuery(this).attr("position") || ""; 112 109 width = jQuery(elem).width(); 113 110 height = jQuery(elem).height(); 114 111 } else { 112 myposition = jQuery(this).css("position") || ""; 115 113 width = jQuery(elem).outerWidth(); 116 114 height = jQuery(elem).outerHeight(); 117 118 115 119 116 … … 147 144 } 148 145 } 146 if (elem == window) { 147 Position = { Top: 0, Left: 0 }; 148 } else { 149 Position = jQuery(elem).position(); 150 } 151 Left = Position.left; 152 Top = Position.top; 149 153 150 154 results = { 151 position: jQuery(this).attr("position"),152 top: top,153 left: left,155 position: myposition, 156 top: Top, 157 left: Left, 154 158 width: width, 155 159 height: height, 156 right: left + width,157 bottom: top + height,160 right: Left + width, 161 bottom: Top + height, 158 162 borderwidth: borderwidth, 159 163 margin: margin, … … 202 206 203 207 results = { 204 top: Math.ceil( 208 top: Math.ceil(offset.top - parentOffset.top), left: Math.ceil(offset.left - parentOffset.left) 205 209 }; 206 210 } return results; … … 244 248 if (myObj.match(reg1)) { 245 249 246 myObj = parseInt(myObj) 250 myObj = parseInt(myObj); 247 251 248 252 } … … 250 254 reg1 = new RegExp("%", "g") 251 255 if (myObj.match(reg1)) { 252 val = Math.ceil(myObj * Maxi_val / 100);256 val = Math.ceil(myObj * Maxi_val / 100); 253 257 return val; 254 258 }
Note: See TracChangeset
for help on using the changeset viewer.