Skip to content

Commit e4ef341

Browse files
committed
Tweak Malchata's IE fixes
1 parent 1cdc023 commit e4ef341

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

stellar.js

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Stellar.js v0.2.2
1+
/* Stellar.js v0.2.3
22
* Copyright 2012, Mark Dalgleish
33
*
44
* This content is released under the MIT License
@@ -221,6 +221,8 @@
221221
verticalOffset,
222222
positionLeft,
223223
positionTop,
224+
marginLeft,
225+
marginTop,
224226
$offsetParent,
225227
offsetLeft,
226228
offsetTop,
@@ -250,25 +252,9 @@
250252
positionLeft = $this.position().left;
251253
positionTop = $this.position().top;
252254

253-
// Catch-all for margin left properties (this evaluates to 'auto' in IE7 and IE8)
254-
if($this.css('margin-left') == "auto")
255-
{
256-
marginLeft = parseInt("0px", 10);
257-
}
258-
else
259-
{
260-
marginLeft = parseInt($this.css('margin-left'), 10);
261-
}
262-
263-
// Catch-all for margin top properties (this evaluates to 'auto' in IE7 and IE8)
264-
if($this.css('margin-top') == "auto")
265-
{
266-
marginTop = parseInt("0px", 10);
267-
}
268-
else
269-
{
270-
marginTop = parseInt($this.css('margin-top'), 10);
271-
}
255+
// Catch-all for margin top/left properties (these evaluate to 'auto' in IE7 and IE8)
256+
marginLeft = ($this.css('margin-left') === 'auto') ? 0 : parseInt($this.css('margin-left'), 10);
257+
marginTop = ($this.css('margin-top') === 'auto') ? 0 : parseInt($this.css('margin-top'), 10);
272258

273259
offsetLeft = $this.offset().left - marginLeft;
274260
offsetTop = $this.offset().top - marginTop;

0 commit comments

Comments
 (0)