Advertisement
luciam

Updates #1 3/3

Jan 20th, 2015
2,671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <!--Start closing code --->
  2. <script type="text/javascript" src="http://static.tumblr.com/bmdsqsc/8mXm7q8vn/jquery.js"></script>
  3. <script>
  4. $(document).ready(function(){
  5. $(".closetab").click(function(){
  6. $("#phoenix").hide();
  7. });
  8. });
  9. </script>
  10. <!--End closing code --->
  11.  
  12. <!-- Start drag code --->
  13.  
  14. <script>window.onload = addListeners();
  15.  
  16. function addListeners(){
  17. document.getElementById('phoenix').addEventListener('mousedown', mouseDown, false);
  18. window.addEventListener('mouseup', mouseUp, false);
  19.  
  20. }
  21.  
  22. function mouseUp()
  23. {
  24. window.removeEventListener('mousemove', divMove, true);
  25. }
  26.  
  27. function mouseDown(e){
  28. window.addEventListener('mousemove', divMove, true);
  29. }
  30.  
  31. function divMove(e){
  32. var div = document.getElementById('phoenix');
  33. div.style.position = 'absolute';
  34. div.style.top = e.clientY + 'px';
  35. div.style.left = e.clientX + 'px';
  36. }</script>
  37.  
  38. <!-- End drag code --->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement