图片缩略图,点击放大到原图大小

图片缩略图,点击放大到原图大小

  1. <script language="javascript">
  2.   var saveWidth = 0;
  3.  function scaleImg(what)
  4.  {
  5.   what = document.getElementById(what);
  6.    if (navigator.appName=="Netscape")
  7.   winW = window.innerWidth;
  8.   if (navigator.appName.indexOf("Microsoft")!=-1)
  9.    winW = document.body.offsetWidth;
  10.   if (what.width&gt;(300) || saveWidth&gt;(300)) {
  11.    if (what.width==(300))
  12.      what.width=saveWidth;
  13.    else
  14.    {
  15.     saveWidth = what.width;
  16.     what.style.cursor = "pointer";
  17.     what.width=(300);
  18.    }
  19.   }
  20.  }
  21. </script>
  22. <img src="http://www.kuangge.net/author/album/picupload/11/1ac78eb2-927f-45ff-a866-437c11d79428.jpg" />




This entry was posted in 技术研究 and tagged . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

以新浪微博帐号登录