Advertisement
Guest User

Untitled

a guest
Dec 15th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Beer example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
  7. <script type='text/javascript'>//<![CDATA[
  8. window.onload=function(){
  9. $(".glass").mouseenter(function(){
  10. $(".liquid").each(function() {
  11. $(this)
  12. .css('visibility', 'visible')
  13. .data("origHeight", $(this).height())
  14. .height(0)
  15. .animate({
  16. height: $(this).data("origHeight")
  17. }, 1200);
  18. });
  19. $(this).unbind('mouseenter')
  20. });
  21.  
  22. }//]]>
  23.  
  24. </script>
  25. <style>
  26. .glass {
  27. height: 200px;
  28. position: relative;
  29. background-image: url('http://i40.tinypic.com/11hyr1j.png');
  30. /* Beer Glass */
  31. background-repeat: no-repeat;
  32. }
  33. .liquid {
  34. z-index:-1;
  35. position:absolute;
  36. bottom:0;
  37. width: 200px;
  38. background-image: url('http://i44.tinypic.com/f0vxbt.jpg');
  39. /* Beer Liquid Pattern */
  40. /* Remove the bottom two lines to stop animation */
  41. -webkit-animation: move 150s linear infinite;
  42. -moz-animation: move 150s linear infinite;
  43. }
  44. @-webkit-keyframes move {
  45. 0% {
  46. background-position: 0 0;
  47. }
  48. 100% {
  49. background-position: 2212px 0px;
  50. }
  51. }
  52. @-moz-keyframes move {
  53. 0% {
  54. background-position: 0 0;
  55. }
  56. 100% {
  57. background-position: 2212px 0px;
  58. }
  59. }
  60. </style>
  61. </head>
  62.  
  63. <body>
  64. <div class="glass"><span class="liquid" style="height: 30%;visibility:hidden;"></span>
  65.  
  66. </div>
  67. </body>
  68. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement