Side navigation
Ticket #4263: chromefloatOrig.html
File chromefloatOrig.html, 0.8 KB (added by BenBernanke, February 27, 2009 01:48AM UTC)
Position-Fixed Test Case
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Chrome jQuery Fixed Pos Bug
</title>
</head>
<body style="height: 10000px;">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<button style="position: fixed; left: 100px; top: 50px" onclick="alert($(this).offset().top);">Outside a Div</button>
<div>
<button style="position: fixed; left: 200px; top: 50px" onclick="alert($(this).offset().top);">Inside a Div</button>
</div>
I'd expect these two buttons to always alert() the same value, scroll down a little - they don't.
<br />
Works in Firefox 3.1 and Internet Explorer 7
Fails in Chrome 1.0.154.48 and Safari 3.2 (525.26.13)
</body>
</html>
Download in other formats:
Original Format
File chromefloatOrig.html, 0.8 KB (added by BenBernanke, February 27, 2009 01:48AM UTC)
Position-Fixed Test Case
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Chrome jQuery Fixed Pos Bug
</title>
</head>
<body style="height: 10000px;">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<button style="position: fixed; left: 100px; top: 50px" onclick="alert($(this).offset().top);">Outside a Div</button>
<div>
<button style="position: fixed; left: 200px; top: 50px" onclick="alert($(this).offset().top);">Inside a Div</button>
</div>
I'd expect these two buttons to always alert() the same value, scroll down a little - they don't.
<br />
Works in Firefox 3.1 and Internet Explorer 7
Fails in Chrome 1.0.154.48 and Safari 3.2 (525.26.13)
</body>
</html>