Feb 28, 2011

How to create a Floating Div

Write this in <head> tag:
  1. <script type="text/javascript" src="/js/jquery-min-1.4.4.js"></script>
  2. <script type="text/javascript" src="/js/floating-1.5.js"></script>

write this in <body> tag:

  1. <div id="floatdiv" style="
  2. position:absolute;
  3. width:200px;height:50px;top:10px;right:10px;
  4. padding:16px;background:#FFFFFF;
  5. border:2px solid #2266AA;
  6. z-index:100">
  7. This is a floating javascript menu.
  8. </div>
  9. <script type="text/javascript">
  10. jQuery(document).ready(function($) (
  11. {
  12. $('#floatdiv').addFloating(
  13. {
  14. targetRight: 10,
  15. targetTop: 10,
  16. snap: true
  17. });
  18. });
  19. </script>


No comments:

Post a Comment

Test post after a long time

i want to see the post