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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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>static</title>
michael@0 7 <style type="text/css" media="screen">
michael@0 8 body { margin: 1px; padding: 5px; }
michael@0 9 div.static { position: static; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
michael@0 10 #static-2 { top: 20px; left: 20px; }
michael@0 11 #marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
michael@0 12 </style>
michael@0 13 <script type="text/javascript" src="../../../dist/jquery.js"></script>
michael@0 14 <script type="text/javascript" charset="utf-8">
michael@0 15 $(function() {
michael@0 16 $('.static').click(function() {
michael@0 17 $('#marker').css( $(this).offset() );
michael@0 18 var pos = $(this).position();
michael@0 19 $(this).css({ position: 'absolute', top: pos.top, left: pos.left });
michael@0 20 return false;
michael@0 21 });
michael@0 22 });
michael@0 23 </script>
michael@0 24 </head>
michael@0 25 <body>
michael@0 26 <div id="static-1" class="static"><div id="static-1-1" class="static"><div id="static-1-1-1" class="static"></div></div></div>
michael@0 27 <div id="static-2" class="static"></div>
michael@0 28 <div id="marker"></div>
michael@0 29 <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 30 </body>
michael@0 31 </html>

mercurial