Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #386, Element.position not working correctly when window is scr…
…olled https://mootools.lighthouseapp.com/projects/24057/tickets/386 - Adds test from ticket for hugely offset document - Reverts change to Element.Position which adds scroll offset again to calculated position
- Loading branch information
Showing
2 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<style> | ||
div.container { | ||
height: 800px; | ||
} | ||
#element { | ||
width: 100px; | ||
height: 100px; | ||
background: black; | ||
line-height: 30px; | ||
text-align: center; | ||
font-size: 16px; | ||
color: white; | ||
} | ||
.padding { | ||
height: 600px; | ||
} | ||
</style> | ||
|
||
<div class="container"> | ||
|
||
<p> | ||
The black box should always go to center when clicking each of the | ||
three buttons -- important to test this relative to scrollPosition. | ||
Scroll down for the other buttons. | ||
</p> | ||
|
||
<div id="element">Companion square</div> | ||
|
||
<input type="button" value="Click here to position the element centered (1/3)" /> | ||
|
||
<div class="padding"></div> | ||
|
||
<input type="button" value="Click here to position the element centered (2/3)" /> | ||
|
||
<div class="padding"></div> | ||
|
||
<input type="button" value="Click here to position the element centered (3/3)" /> | ||
|
||
</div> | ||
|
||
<script src="/depender/build?require=More/Element.Position,Core/Element.Event"></script> | ||
|
||
<script type="text/javascript"> | ||
$$('input').addEvent('click', function(){ | ||
document.id('element').position(); | ||
}); | ||
</script> |