Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
84712bd6
Commit
84712bd6
authored
Apr 14, 2011
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting of pull 325. Fixes #4146.
parent
cdb02d09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
css.js
src/css.js
+20
-13
No files found.
src/css.js
View file @
84712bd6
...
...
@@ -9,6 +9,7 @@ var ralpha = /alpha\([^)]*\)/i,
rnum
=
/^-
?\d
/
,
rrelNum
=
/^
[
+
\-]
=/
,
rrelNumFilter
=
/
[^
+
\-\.\d
e
]
+/g
,
rinputbutton
=
/input|button/i
,
cssShow
=
{
position
:
"absolute"
,
visibility
:
"hidden"
,
display
:
"block"
},
cssWidth
=
[
"Left"
,
"Right"
],
...
...
@@ -338,39 +339,45 @@ curCSS = getComputedStyle || currentStyle;
function
getWH
(
elem
,
name
,
extra
)
{
var
which
=
name
===
"width"
?
cssWidth
:
cssHeight
,
cur
=
curCSS
(
elem
,
name
),
// We're addressing the way Firefox handles certain inputs and buttons, offsetWidth/height actually returns a normal width/height
ff
=
/input|button/i
.
test
(
elem
.
tagName
.
toLowerCase
()
)
&&
curCSS
(
elem
,
'-moz-box-sizing'
)
===
'border-box'
;
cur
=
curCSS
(
elem
,
name
),
// We're addressing the way Firefox handles certain inputs and buttons,
// offsetWidth/height actually returns a normal width/height
boxSizing
=
rinputbutton
.
test
(
elem
.
nodeName
)
&&
curCSS
(
elem
,
"-moz-box-sizing"
)
===
"border-box"
;
// IE will return auto if we try to grab a width/height that is not set
if
(
ff
||
cur
===
'auto'
)
{
if
(
boxSizing
||
cur
===
"auto"
)
{
cur
=
name
===
"width"
?
elem
.
offsetWidth
:
elem
.
offsetHeight
;
}
//
Fixes an IE7 effects test. "Chain show hide" was returning "scroll" instead of "visible"
if
(
name
==
"height"
)
{
//
Make sure that IE7 returns the correct computed value for display
if
(
name
===
"height"
)
{
elem
.
offsetHeight
;
}
var
val
=
parseFloat
(
cur
)
||
0
;
var
val
=
parseFloat
(
cur
)
||
0
;
if
(
extra
)
{
for
(
var
i
=
0
,
len
=
which
.
length
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
,
len
=
which
.
length
;
i
<
len
;
i
++
)
{
var
dir
=
which
[
i
];
// outerWidth/height
if
(
extra
===
"border"
||
extra
===
'margin'
)
{
if
(
extra
===
"border"
||
extra
===
"margin"
)
{
val
+=
parseFloat
(
jQuery
.
css
(
elem
,
"border"
+
dir
+
"Width"
))
||
0
;
val
+=
parseFloat
(
jQuery
.
css
(
elem
,
"padding"
+
dir
))
||
0
;
if
(
extra
==
'margin'
)
{
if
(
extra
==
"margin"
)
{
val
+=
parseFloat
(
jQuery
.
css
(
elem
,
"margin"
+
dir
))
||
0
;
}
}
// innerWidth/height
else
{
}
else
{
val
+=
parseFloat
(
jQuery
.
css
(
elem
,
"padding"
+
dir
))
||
0
;
}
}
}
return
val
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment