Ignore:
Timestamp:
Nov 24, 2010, 12:42:36 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] fix bugs with FF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/jquery.dimensions.js

    r7816 r7867  
    11/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
    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  */
     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*/
    1515(function (jQuery) {
    1616    jQuery.dimensions = { version: '1.3' };
     
    6464
    6565
    66             var left = 0, top = 0, offset, parentOffset, offsetParent, results;
     66            var Left = 0, Top = 0, offset, parentOffset, offsetParent, results;
    6767            var borderwidth = { width: "0 0 0 0",
    6868                top: 0,
     
    8484            };
    8585            //=====================================================================
     86            myposition = "";
    8687            results = {
    87                 position: jQuery(this).attr("position"),
     88                position: "",
    8889                top: 0,
    8990                left: 0,
     
    102103                if (elem.nodeName) nodeName = elem.nodeName;
    103104
     105
    104106                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") || "";
    112109                    width = jQuery(elem).width();
    113110                    height = jQuery(elem).height();
    114111                } else {
     112                    myposition = jQuery(this).css("position") || "";
    115113                    width = jQuery(elem).outerWidth();
    116114                    height = jQuery(elem).outerHeight();
    117 
    118115
    119116
     
    147144                    }
    148145                }
     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;
    149153
    150154                results = {
    151                     position: jQuery(this).attr("position"),
    152                     top: top,
    153                     left: left,
     155                    position: myposition,
     156                    top: Top,
     157                    left: Left,
    154158                    width: width,
    155159                    height: height,
    156                     right: left + width,
    157                     bottom: top + height,
     160                    right: Left + width,
     161                    bottom: Top + height,
    158162                    borderwidth: borderwidth,
    159163                    margin: margin,
     
    202206
    203207                results = {
    204                     top: Math.ceil( offset.top - parentOffset.top), left: Math.ceil(offset.left - parentOffset.left)
     208                    top: Math.ceil(offset.top - parentOffset.top), left: Math.ceil(offset.left - parentOffset.left)
    205209                };
    206210            } return results;
     
    244248                if (myObj.match(reg1)) {
    245249
    246                     myObj = parseInt(myObj) ;
     250                    myObj = parseInt(myObj);
    247251
    248252                }
     
    250254                    reg1 = new RegExp("%", "g")
    251255                    if (myObj.match(reg1)) {
    252                         val =Math.ceil(myObj * Maxi_val / 100);
     256                        val = Math.ceil(myObj * Maxi_val / 100);
    253257                        return val;
    254258                    }
Note: See TracChangeset for help on using the changeset viewer.