daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest Mar 19th, 2014 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.   <meta charset="utf-8">
  5.   <title>zsp panorama</title>
  6.   <style>
  7.   #panoram
  8.   {
  9.         background-color:#00FF00;
  10.         width:650px;
  11.         height:400px;
  12.         overflow:hidden;
  13.   }
  14.  
  15.   .foto
  16.   {
  17.                 position:relative;
  18.   }
  19.   </style>
  20.   <script src="jquery-1.10.2.js"></script>
  21.  
  22. </head>
  23. <body>
  24.  
  25. <div id="panoram"><img src="1.jpg" class="foto"></div>
  26.  
  27. <script>
  28. $(document).ready(
  29.         var lastMousePosition = {x: 0, y: 0};
  30.         $("#panoram").mouseup(function(e) {
  31.                 lastMousePosition = = {x: e.pageX, y: e.pageY}; // Pozycja myszki przy klikniÄ™ciu
  32.          
  33.                 $(this).mousemove(function(e) {
  34.                         var mousePosition = {x: e.pageX, y: e.pageY};
  35.          
  36.                         var delta = {x: (lastMousePosition.x - mousePosition.x), y: (lastMousePosition.y - mousePosition.y)};
  37.          
  38.                         $(this).find("img").css({left: "+=" + delta.x + "px"});
  39.                 });
  40.         });
  41. });
  42. </script>
  43.  
  44. </body>
  45. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top