图片 自动收缩 和支持IE和火狐浏览器的加入收藏夹js代码 js

<div id="divimg" style="overflow:hidden;height:422px;width:988px;">
  <img src="/Images/Imagesarticle/AdPic60yearBig.gif" width="988" height="422" alt="" />
</div>
<script language="javascript" type="test/javascript">
setTimeout("DrawImage('divimg') ",1);
function DrawImage(img) {
        var i = 20;
        var ig = document.getElementById(img);
        if (parseInt(ig.style.height.toString().substring(0, ig.style.height.toString().length - 2)) > 30) {
            oheight = parseInt(ig.style.height.toString().substring(0, ig.style.height.toString().length - 2)) - parseInt(i);
            ig.style.height = oheight + "px";
            setTimeout("DrawImage('divimg')", 40);
        }
        else {
            document.getElementById('AdPicBig').style.display = 'none'; document.getElementById('AdPicSmall').style.display = '';
        }
    }
</script>
======================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++
======================================================

支持IE和火狐浏览器的加入收藏夹js代码
如果想要在opera和Firefox下支持加入收藏夹功能,只需要在连接加上rel="sidebar"即可.

<script>
function addfavorite()
{
if (document.all)
{
window.external.addFavorite('http://www.corange.cn,'corange.cn');
}
else if (window.sidebar)
{
window.sidebar.addPanel('corange.cn', 'http://www.corange.cn, "");
}
}
</script>
<a href="#" onclick="addfavorite()">把corange.cn加入收藏</a>


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/piperzero/archive/2008/12/07/3468694.aspx

你可能感兴趣的:(浏览器)