Advertisement
Guest User

Untitled

a guest
May 1st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. $(document).ready( function() {
  2. $('#div img').hover(
  3. function() {
  4. $(this).animate({ 'zoom': 1.2 }, 400);
  5. },
  6. function() {
  7. $(this).animate({ 'zoom': 1 }, 400);
  8. });
  9. });
  10.  
  11. $("#ZoomIn").click(ZoomIn());
  12.  
  13. $("#ZoomOut").click(ZoomOut());
  14.  
  15. function ZoomIn (event) {
  16.  
  17. $("#div img").width(
  18. $("#div img").width() * 1.2
  19. );
  20.  
  21. $("#div img").height(
  22. $("#div img").height() * 1.2
  23. );
  24. },
  25.  
  26. function ZoomOut (event) {
  27.  
  28. $("#div img").width(
  29. $("#imgDtls").width() * 0.5
  30. );
  31.  
  32. $("#div img").height(
  33. $("#div img").height() * 0.5
  34. );
  35. }
  36.  
  37. var currentZoom = 1.0;
  38.  
  39. $(document).ready(function () {
  40. $('#btn_ZoomIn').click(
  41. function () {
  42. $('#divName').animate({ 'zoom': currentZoom += .1 }, 'slow');
  43. })
  44. $('#btn_ZoomOut').click(
  45. function () {
  46. $('#divName').animate({ 'zoom': currentZoom -= .1 }, 'slow');
  47. })
  48. $('#btn_ZoomReset').click(
  49. function () {
  50. currentZoom = 1.0
  51. $('#divName').animate({ 'zoom': 1 }, 'slow');
  52. })
  53. });
  54.  
  55. $('image').animate({ 'zoom': 1}, 400);
  56.  
  57. <script>
  58. $(document).ready(function(){
  59. $('#ex1').zoom();
  60.  
  61. });
  62. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement