Guest User

Untitled

a guest
Dec 2nd, 2014
378
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <head>
  5.     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  6.     <script type="text/javascript">
  7. $(document).ready(function() {
  8.     var imageLinks = $('a[href$=".png"], a[href$=".jpg"], a[href$=".gif"], a[href$=".bmp"]');
  9.     if (imageLinks.children('img').length) {
  10.         imageLinks.children('img').each(function() {
  11.             var currentTitle = $(this).attr('title');
  12.             $(this).attr('title', currentTitle + ' (click to enlarge image)');
  13.         });
  14.         imageLinks.click(function(e) {
  15.             e.preventDefault();
  16.             $(this).children('img').toggleClass('expanded');
  17.         });
  18.     }
  19. });
  20.     </script>
  21.     <style media="screen" type="text/css">
  22. img {
  23.     height: auto;
  24.     max-width: 100%;
  25. }
  26. img.expanded {
  27.     max-width: none;
  28. }
  29.     </style>
  30. </head>
  31.  
  32. <body>
  33.     <div style="width: 800px">
  34.         <a href="http://upload.wikimedia.org/wikipedia/commons/6/6f/Earth_Eastern_Hemisphere.jpg">
  35.             <img src="http://upload.wikimedia.org/wikipedia/commons/6/6f/Earth_Eastern_Hemisphere.jpg" />
  36.         </a>
  37.     </div>
  38. </body>
  39.  
  40. </html>
RAW Paste Data