dom/tests/mochitest/ajax/jquery/test/data/offset/absolute.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
michael@0 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
michael@0 3 <html>
michael@0 4 <head>
michael@0 5 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
michael@0 6 <title>absolute</title>
michael@0 7 <style type="text/css" media="screen">
michael@0 8 body { margin: 1px; padding: 5px; }
michael@0 9 div.absolute { position: absolute; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; }
michael@0 10 #absolute-1 { top: 0; left: 0; }
michael@0 11 #absolute-1-1 { top: 1px; left: 1px; }
michael@0 12 #absolute-1-1-1 { top: 1px; left: 1px; }
michael@0 13 #absolute-2 { top: 19px; left: 19px; }
michael@0 14 #marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
michael@0 15 p.instructions { position: absolute; bottom: 0; }
michael@0 16 </style>
michael@0 17 <script type="text/javascript" src="../../../dist/jquery.js"></script>
michael@0 18 <script type="text/javascript" charset="utf-8">
michael@0 19 $(function() {
michael@0 20 $('.absolute').click(function() {
michael@0 21 $('#marker').css( $(this).offset() );
michael@0 22 var pos = $(this).position();
michael@0 23 $(this).css({ top: pos.top, left: pos.left });
michael@0 24 return false;
michael@0 25 });
michael@0 26 });
michael@0 27 </script>
michael@0 28 </head>
michael@0 29 <body>
michael@0 30 <div id="absolute-1" class="absolute">absolute-1
michael@0 31 <div id="absolute-1-1" class="absolute">absolute-1-1
michael@0 32 <div id="absolute-1-1-1" class="absolute">absolute-1-1-1</div>
michael@0 33 </div>
michael@0 34 </div>
michael@0 35 <div id="absolute-2" class="absolute">absolute-2</div>
michael@0 36 <div id="marker"></div>
michael@0 37 <p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
michael@0 38 </body>
michael@0 39 </html>

mercurial