【#文档大全网# 导语】以下是®文档大全网的小编为您整理的《设为首页代码大全》,欢迎阅读!
设为首页代码大全
1.文字型:
onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.z188.net');" href="#">设为首页 范例: 设为首页
2.按钮型: TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.z188.net');" href="#">
离开时自动提示设为首页
onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://www.www.z188.net')))BASEBody.setHomePage('http://www.z188.net/');">
------------------------------------------------------------- 打开页面时自动弹出窗口询问是否设为首页 将以下代码放在之间:
onclick="myhomepage();">
再将下面代码加入内:
onload="myhomepage();"
即:
------------------------------------------------------------------------------
鼠标指向时提示设为首页
将下列代码插入区中: href="http://www.z188.net/" onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.z188.net');" target="_blank">设为首页
------------------------------------------------------------------------------- 关闭当前窗口的功能
这里我们可以先输入用来标示的文字“关闭窗口”,用鼠标拖动选中它,在“Link”输入框中键入“/”,同时切入源代码窗口,在链接代码中键入该事件-onclick=“javascript:window.close(); return false;”。
完整的代码为:< a href=“/”onclick=“javascript:window.close(); return false;”>关闭窗口< /a>
本文来源:https://www.wddqxz.cn/d0a399c4bb4cf7ec4afed095.html