Advertisement
pusatdata

JS: Zoom Image Bagus Buat Menu

Jan 17th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. https://www.hscripts.com/scripts/JavaScript/zooming-image.php
  2.  
  3. =================
  4. Kode JS:
  5.  
  6.  
  7. <!-- Script by hscripts.com -->
  8. <!-- More scripts @www.hscripts.com -->
  9. <script type="text/javascript">
  10. //set the time delay,imgsize,arrsize.
  11. var delay=20;
  12. var imgsize=5;
  13. var arrsize=4;
  14. var timeon;
  15. var whoc = new Array(arrsize);
  16. var wid;
  17. var hei;
  18. var i=0;
  19. function zoom_out(p,q,which)
  20. {
  21. if(which.width <= p)
  22. which.width += imgsize;
  23. if(which.height <= q)
  24. which.height += imgsize;
  25. if(which.width <= p)
  26. {
  27. var tmp=which.id;
  28. timeon=eval("setTimeout('zoom_out("+p+","+q+","+tmp+")', delay)");
  29. }
  30. if(which.width > p)
  31. {
  32. zoom_check(which.id);
  33. clearTimeout(timeon);
  34. }
  35. }
  36. function zoom_check(xx)
  37. {
  38. for(var x=0; x<(whoc.length);x++)
  39. {
  40. if(whoc[x] != null && whoc[x] != xx)
  41. {
  42. var ff = document.getElementById(whoc[x]);
  43. ff.width=wid;
  44. ff.height=hei;
  45. }
  46. }
  47. }
  48. function zoom_in(r,s,asd)
  49. {
  50. if(i<(whoc.length-1))i++;
  51. elsei=0;
  52. whoc[i] = asd.id;
  53. if(asd.width >= r)
  54. asd.width -= imgsize;
  55. if(asd.height >= s)
  56. asd.height -= imgsize;
  57. asd.width=r;
  58. asd.height=s;
  59. wid=asd.width;
  60. hei=asd.height;
  61. }
  62. function ctck()
  63. {
  64. var sds = document.getElementById("dum");
  65. if(sds == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
  66. var sdss = document.getElementById("dumdiv");
  67. if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
  68. }
  69. </script>
  70. <!-- Script by hscripts.com-->
  71.  
  72.  
  73.  
  74. Kode HTML:
  75.  
  76. <!-- Script by hscripts.com -->
  77. <table align=center cellspacing=2 cellpadding=2 height=100% width=100%><tr>
  78. <td align=center width=120 height=125 style='cursor:pointer;'>
  79. <img id="myPicture1" src="hzoom-images/book.gif" width="40" height="48" onMouseover="zoom_out(55,65,this)" onMouseout="zoom_in(40,48,this)"></td>
  80. <td width=10></td>
  81. <td align=center width=120 height=125 style='cursor:pointer;'>
  82. <img id="myPicture2" src="hzoom-images/globe.gif" width="40" height="48" onMouseover="zoom_out(55,65,this)" onMouseout="zoom_in(40,48,this)"></td>
  83. <td width=10></td>
  84. <td align=center width=120 height=125 style='cursor:pointer;'>
  85. <img id="myPicture3" src="hzoom-images/email.gif" width="40" height="48" onMouseover="zoom_out(55,65,this)" onMouseout="zoom_in(40,48,this)"></td>
  86. <td width=10></td>
  87. <td align=center width=120 height=125 style='cursor:pointer;'>
  88. <img id="myPicture4" src="hzoom-images/clock.gif" width="40" height="48" onMouseover="zoom_out(55,65,this)" onMouseout="zoom_in(40,48,this)"></td>
  89. </tr>
  90. <tr><td colspan=7>
  91. <div align=center style="font-size: 10px;color: #dadada;" id="dumdiv">
  92. <a href="https://www.hscripts.com" id="dum" style="text-decoration:none;color: #dadada;">© hscripts.com</a>
  93. </div>
  94. <script language="javascript">document.onload = ctck();</script>
  95. </td></tr>
  96. </table>
  97. <!-- Script by hscripts.com -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement