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


    <div id="divimg" style="overflow:hidden;height:422px;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

  • 相关阅读:
    JS4
    JS3
    JS2
    JS1
    Dos命令
    面向对象的复习
    9.14Css
    9.13列表的用法
    9.12Css
    9.11Css
  • 原文地址:https://www.cnblogs.com/jiangchongwei/p/1576271.html
Copyright © 2020-2023  润新知