Ticket #4202: offset.html
File offset.html, 546 bytes (added by , 13 years ago) |
---|
Line | |
---|---|
1 | <!doctype html> |
2 | <html lang="en"> |
3 | <head> |
4 | <title>offset test</title> |
5 | <style type="text/css"> |
6 | body{ |
7 | width: 200px; |
8 | margin: 0 auto; |
9 | background: #eee; |
10 | position: relative; |
11 | } |
12 | #foo{ |
13 | height: 400px; |
14 | background: #bbb; |
15 | } |
16 | </style> |
17 | </head> |
18 | <body> |
19 | <div id="foo"> |
20 | <div id="bar"> |
21 | </div> |
22 | </div> |
23 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script> |
24 | <script type="text/javascript"> |
25 | jQuery(function($){ |
26 | alert($('#foo').offset().left); |
27 | }); |
28 | </script> |
29 | </body> |
30 | </html> |