1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

非常全的主页设置代码

本帖由 小叶2006-05-19 发布。版面名称:前端开发

  1. 小叶

    小叶 New Member

    注册:
    2005-09-04
    帖子:
    17,941
    赞:
    33
    非常全的主页设置代码

    关闭网页时弹出设为主页对话框代码:
    <BODY id=iehomepage
    onunload="iehomepage.style.behavior='url(#default#homepage)';if(!(iehomepage.isHomePage('http://www.test.com')))iehomepage.setHomePage('http://www.test.com');">

    打开网页弹出设为主页对话框代码:
    <BODY id=iehomepage
    onload="iehomepage.style.behavior='url(#default#homepage)';if(!(iehomepage.isHomePage('http://www.test.com')))iehomepage.setHomePage('http://www.test.com');">

    单击链接设为主页
    <a href=# onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.test.com');">设为主页</a>

    鼠标滑过设定为主页
    <a href=# onMouseOver="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.test.com');">设为主页</a>

    附添加到收藏夹代码:

    离开网页时弹出
    <script language="javascript">
    function bookmarkit(){window.external.addFavorite('http://www.test.com','个人网站')}</script>
    <body onunload="bookmarkit()">

    网页载入时弹出
    <script language="javascript">
    function bookmarkit(){window.external.addFavorite('http://www.test.com','个人网站')}
    </script>
    <body onload="bookmarkit()">

    右键弹出
    <script language=javascript1.2>
    document.all.onMouseDown=new Function("if (event.button==2||event.button==3)window.external.addFavorite('http://www.test.com','个人网站')")
    </script>

    单击文字弹出
    <script language="javascript">
    function bookmarkit(){window.external.addFavorite('http://www.test.com','个人网站')}
    if (document.all)document.write('<a href="#" onClick="bookmarkit()">加入收藏夹</a>')
    </script>

    鼠标滑过文字弹出
    <script language="javascript">
    function bookmarkit(){window.external.addFavorite('http://www.test.com','个人网站')}
    if (document.all)document.write('<a href="#" onMouseOver="bookmarkit()">加入收藏夹</a>')
     
  2. srsman

    srsman Active Member

    注册:
    2005-11-08
    帖子:
    1,920
    赞:
    6
    好黑呀。。
     
  3. 空心菜

    空心菜 New Member

    注册:
    2005-10-05
    帖子:
    85
    赞:
    0
  4. 西子宜

    西子宜 Well-Known Member

    注册:
    2005-09-05
    帖子:
    15,739
    赞:
    62
    挖,好东西
     
  5. camper

    camper New Member

    注册:
    2006-05-19
    帖子:
    63
    赞:
    0
    好东西。。收下了。。