1
0

body.html 841 B

1234567891011121314151617181920212223242526
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  6. <title>body</title>
  7. <style type="text/css" media="screen">
  8. body { margin: 1px; padding: 5px; position: relative }
  9. #marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
  10. #firstElement { width: 50px; height: 50px; background: green; }
  11. </style>
  12. <script src="../../jquery.js"></script>
  13. <script type="text/javascript" charset="utf-8">
  14. jQuery(function($) {
  15. $('body').click(function() {
  16. $('#marker').css( $(this).offset() );
  17. return false;
  18. });
  19. });
  20. </script>
  21. </head>
  22. <body>
  23. <div id="firstElement"></div>
  24. <div id="marker"></div>
  25. </body>
  26. </html>