• 收藏本站和设为主页代码(HTML)


    1:实现"另入收藏"功能的代码如下: 

    <a href="javascript:window.external.AddFavorite('http://www.chinesedragon.com.cn','中国龙')">加入收藏</a> 


    你只需将链接与站名改为你自己的站名即可. 

    如果你要实现鼠标划过时即提示是否加入收藏,只需将代码改为: 

    <a onmouseover="window.external.addFavorite('http://www.chinesedragon.com.cn','随中国龙')" target=_self href=http://www.chinesedragon.com.cn/>加入收藏</a> 
    ---------------------------------- 
    2.设为首页代码(html源码) 

    图片链接 
    <a style="cursor:hand" onclick="this.style.behavior=’url(#default#homepage)’; 
    this.setHomePage(’http://www.chinesedragon.com.cn/’);"> 
    <img width=16 height=16 border=0 src="images/house.png"> 
    <u> Set as Home Page</u></a> 



    1.文字型: 
    <a onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.chinesedragon.com.cn’);" href="#">设为首页</a> 
    范例: 
    设为首页 

    2.按钮型: 
    <input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.chinesedragon.com.cn’);" href="#"> 


    离开时自动提示设为首页 

    <body onunload="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(’http://www.vvq.com.cn/’)))BASEBody.setHomePage(’http://www.vvq.com.cn//’);"> 


    ------------------------------------------------------------- 
    打开页面时自动弹出窗口询问是否设为首页 
    将以下代码放在<head></head>之间: 

    <script language="javascript"> 
    function myhomepage(){ 
    this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(’http://www.8485.com.cn’); 

    </script> 
    <p align="center"><a href="http:netbei.com" name="homepage" 
    onclick="myhomepage();"></a> 




    再将下面代码加入<body>内: 

    onload="myhomepage();" 
    即:<body onload="myhomepage();"> 

    -------------------------------------------------------------------- 
    鼠标指向时提示设为首页 

    将下列代码插入<body>区中: 

    <A href="http://www.8520.com.cn/" onmouseover="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.8520.com.cn’);" target="_blank">设为首页</A> 
    -------------------------------------------------------------------- 
    关闭当前窗口的功能 

    这里我们可以先输入用来标示的文字“关闭窗口”,用鼠标拖动选中它,在“Link”输入框中键入“/”,同时切入源代码窗口,在链接代码中键入该事件-onclick=“javascript:window.close(); return false;”。 
    完整的代码为:< a href=“/”onclick=“javascript:window.close(); return false;”>关闭窗口< /a> 

    ---------------------------------- 
    多思考,多创新,才是正道!
  • 相关阅读:
    LeetCode Single Number
    Leetcode Populating Next Right Pointers in Each Node
    LeetCode Permutations
    Leetcode Sum Root to Leaf Numbers
    LeetCode Candy
    LeetCode Sort List
    LeetCode Remove Duplicates from Sorted List II
    LeetCode Remove Duplicates from Sorted List
    spring MVC HandlerInterceptorAdapter
    yum
  • 原文地址:https://www.cnblogs.com/shuang121/p/2091258.html
Copyright © 2020-2023  润新知