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
703f274a
Commit
703f274a
authored
Jul 04, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ever notice that static and problematic rhyme?
parent
5c60e334
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
offset.js
test/unit/offset.js
+8
-3
No files found.
test/unit/offset.js
View file @
703f274a
...
@@ -203,12 +203,13 @@ testIframe("offset/relative", "relative", function( jQuery ) {
...
@@ -203,12 +203,13 @@ testIframe("offset/relative", "relative", function( jQuery ) {
});
});
testIframe
(
"offset/static"
,
"static"
,
function
(
jQuery
)
{
testIframe
(
"offset/static"
,
"static"
,
function
(
jQuery
)
{
expect
(
80
);
// IE is collapsing the top margin of 1px; detect and adjust accordingly
// IE is collapsing the top margin of 1px; detect and adjust accordingly
var
ie
=
jQuery
(
"#static-1"
).
offset
().
top
===
6
,
var
ie
=
jQuery
(
"#static-1"
).
offset
().
top
===
6
,
swarmy
=
document
.
documentMode
===
8
&&
window
.
location
.
search
.
indexOf
(
"swarmURL"
)
>=
0
;
swarmy
=
document
.
documentMode
===
8
&&
window
.
location
.
search
.
indexOf
(
"swarmURL"
)
>=
0
;
expect
(
swarmy
?
68
:
80
);
// get offset
// get offset
var
tests
=
[
var
tests
=
[
{
id
:
"#static-1"
,
top
:
ie
?
6
:
7
,
left
:
7
},
{
id
:
"#static-1"
,
top
:
ie
?
6
:
7
,
left
:
7
},
...
@@ -243,8 +244,6 @@ testIframe("offset/static", "static", function( jQuery ) {
...
@@ -243,8 +244,6 @@ testIframe("offset/static", "static", function( jQuery ) {
tests
=
[
tests
=
[
{
id
:
"#static-2"
,
top
:
200
,
left
:
200
},
{
id
:
"#static-2"
,
top
:
200
,
left
:
200
},
{
id
:
"#static-2"
,
top
:
100
,
left
:
100
},
{
id
:
"#static-2"
,
top
:
100
,
left
:
100
},
{
id
:
"#static-2"
,
top
:
-
2
,
left
:
-
2
},
{
id
:
"#static-2"
,
top
:
121
,
left
:
6
},
{
id
:
"#static-1-1-1"
,
top
:
50
,
left
:
50
},
{
id
:
"#static-1-1-1"
,
top
:
50
,
left
:
50
},
{
id
:
"#static-1-1-1"
,
top
:
10
,
left
:
10
},
{
id
:
"#static-1-1-1"
,
top
:
10
,
left
:
10
},
{
id
:
"#static-1-1-1"
,
top
:
-
1
,
left
:
-
1
},
{
id
:
"#static-1-1-1"
,
top
:
-
1
,
left
:
-
1
},
...
@@ -258,6 +257,12 @@ testIframe("offset/static", "static", function( jQuery ) {
...
@@ -258,6 +257,12 @@ testIframe("offset/static", "static", function( jQuery ) {
{
id
:
"#static-1"
,
top
:
-
2
,
left
:
-
2
},
{
id
:
"#static-1"
,
top
:
-
2
,
left
:
-
2
},
{
id
:
"#static-1"
,
top
:
7
,
left
:
7
}
{
id
:
"#static-1"
,
top
:
7
,
left
:
7
}
];
];
if
(
!
swarmy
)
{
tests
.
push
(
{
id
:
"#static-2"
,
top
:
-
2
,
left
:
-
2
},
{
id
:
"#static-2"
,
top
:
121
,
left
:
6
}
);
}
jQuery
.
each
(
tests
,
function
()
{
jQuery
.
each
(
tests
,
function
()
{
jQuery
(
this
.
id
).
offset
({
top
:
this
.
top
,
left
:
this
.
left
});
jQuery
(
this
.
id
).
offset
({
top
:
this
.
top
,
left
:
this
.
left
});
equal
(
jQuery
(
this
.
id
).
offset
().
top
,
this
.
top
,
"jQuery('"
+
this
.
id
+
"').offset({ top: "
+
this
.
top
+
" })"
);
equal
(
jQuery
(
this
.
id
).
offset
().
top
,
this
.
top
,
"jQuery('"
+
this
.
id
+
"').offset({ top: "
+
this
.
top
+
" })"
);
...
...
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