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
e317bb71
Commit
e317bb71
authored
Dec 04, 2007
by
Brandon Aaron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
offset now uses clientLeft and clientTop instead of calculating html border in IE
parent
f576ceee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
offset.js
src/offset.js
+5
-6
No files found.
src/offset.js
View file @
e317bb71
...
...
@@ -23,13 +23,12 @@ jQuery.fn.offset = function() {
);
// IE adds the HTML element's border, by default it is medium which is 2px
// IE 6 and
IE
7 quirks mode the border width is overwritable by the following css html { border: 0; }
// IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
// IE 7 standards mode, the border is always 2px
if
(
msie
)
{
var
border
=
jQuery
(
"html"
).
css
(
"borderWidth"
);
border
=
(
border
==
"medium"
||
jQuery
.
boxModel
&&
parseInt
(
version
)
>=
7
)
&&
2
||
border
;
add
(
-
border
,
-
border
);
}
// This border/offset is typically represented by the clientLeft and clientTop properties
// However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
// Therefore this method will be off by 2px in IE while in quirksmode
add
(
-
doc
.
documentElement
.
clientLeft
,
-
doc
.
documentElement
.
clientTop
);
// Otherwise loop through the offsetParents and parentNodes
}
else
{
...
...
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