http://www.huddletogether.com/projects/lightbox2/抄一下就是了

解决方案 »

  1.   

    搞定:
    效果示例(写到我的BLOG了):http://www.lastidea.net/blog/BlogShow.asp?ID=156把下面的代码不用改动可以直接用,注意,如果网页里有很多JS,变量可能会冲突。还有JS块要放在<img>后面。<IMG id="IMG1" src="http://www.lastidea.net/blog/logo.gif" border="1" width="88" height="33" onMouseOver="timer()" onMouseOut="reset()">
    <script language="javascript"> 

    var img_height=200;//此值可该;设定图变到的最大高度
    var img_width=200;//此值可改;设定图变到的最大宽度(与高度img_height相比谁先达到谁的值为准!汗,不会表达!)
    var k=10;        //图一次变大的值,此值越大,图变大的越快
    var timer1=10;  //图多长时间变化一次,值些小,变化越快
    var sh;
             var oldWidth=parseInt(document.all["IMG1"].width);
    var oldHeight=parseInt(document.all["IMG1"].height); function  timer(){ 

    sh=setInterval("image_test()",timer1);
    }
    function image_test(){
    var j=oldWidth/oldHeight;
    document.all["IMG1"].width=document.all["IMG1"].width+j*k ;
    document.all["IMG1"].height=document.all["IMG1"].height+k;

    if (document.all["IMG1"].height>=img_height||document.all["IMG1"].width>=img_width){
    clearInterval(sh)
    }
    }
    function reset(){
    document.all["IMG1"].width=oldWidth;
    document.all["IMG1"].height=oldHeight;
    clearTimeout(sh);
    }
    </script>
      

  2.   

    楼上的导致外面大图变形.
    http://mobile.msn.com.cn/content/AddContact.asp
    这个东西外面的绿色部分图片不变形.
      

  3.   

    tancy2008() 提供的不错,谢谢拉,不过也得谢谢windzjp(赵依燃),你的博客不错.
      

  4.   

    我只写的脚本的中心部分,想要用到实际中,还有再改一下函数,让函数可以控制每个你想变化的图片!(在调用函数时传递相应图片的ID)。如果要做成微软的那样子,让多个层(层里放图片)在一张背景图上!还有要改层的坐标,让他看起来是从中心变大的!!晕,这么一看还还要很多东西要做!还是用FLASH简单!