Commit d9b1d343 authored by John Resig's avatar John Resig

$.css() now accounts for borders in addition to padding when calculating the...

$.css() now accounts for borders in addition to padding when calculating the height/width of an element.
parent a70ab656
...@@ -353,10 +353,15 @@ $.apply = function(o,f,a) { ...@@ -353,10 +353,15 @@ $.apply = function(o,f,a) {
$.getCSS = function(e,p) { $.getCSS = function(e,p) {
// Adapted from Prototype 1.4.0 // Adapted from Prototype 1.4.0
if ( p == 'height' || p == 'width' ) { if ( p == 'height' || p == 'width' ) {
var ph = $.browser == "msie" ? 0 :
parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom")); // Handle extra width/height provided by the W3C box model
var pw = $.browser == "msie" ? 0 : var ph = !$.boxModel ? 0 :
parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight")); parseInt($.css(e,"paddingTop")) + parseInt($.css(e,"paddingBottom")) +
parseInt($.css(e,"borderTop")) + parseInt($.css(e,"borderBottom"));
var pw = !$.boxModel ? 0 :
parseInt($.css(e,"paddingLeft")) + parseInt($.css(e,"paddingRight")) +
parseInt($.css(e,"borderLeft")) + parseInt($.css(e,"borderRight"));
var oHeight, oWidth; var oHeight, oWidth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment