Tessmore

Untitled

Nov 5th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.03 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
  5.   <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
  6.   <script src="jquery.ui.core.js"></script>
  7.   <script src="jquery.ui.widget.js"></script>
  8.   <script src="jquery.ui.mouse.js"></script>
  9.   <script src="jquery.ui.draggable.js"></script>
  10. </head>
  11. <body>
  12.  
  13.   <div class="two-one last">
  14.     <h2>Recent Work</h2>
  15.  
  16.     <ul class="recent">
  17.       <li class="image">
  18.         <img src="a.jpg">
  19.         <a href="b.jpg" class="link">View</a>
  20.       </li>
  21.  
  22.       <!-- more li here -->
  23.  
  24.      </ul>
  25.    </div>
  26.  
  27. <script>
  28. var link = $('.link');
  29.  
  30. link.click(function()
  31. {
  32.   var big_image_url = $(this).attr('href');
  33.  
  34.   var big_img = $('<img id="draggable">').attr('src', big_image_url);
  35.  
  36.   big_img.load(function()
  37.   {
  38.     $("body").prepend(big_img);
  39.     $('#draggable').draggable();
  40.   });
  41.  
  42.   return false; // To prevent a href from working
  43. });
  44. </script>
  45.  
  46. </body>
  47. </html>
  48.  
Advertisement
Add Comment
Please, Sign In to add comment