FLASH里加入收藏、设为首页代码:
加入收藏:
on (release) { getURL("javascript:window.external.AddFavorite('http://www.maxfreshclub.com','郑州市冯特职业培训学校');"); } 设为首页:
getURL("javascript:document.all.link[0].style.behavior='url(#default#homepage)';document.all.link[0].setHomePage('http://您的网址');");//设为首页 //加入收藏
on(release){ getURL("javascript:void window.external.AddFavorite('http://www.maxfreshclub.com','网站名');", "_self", "POST"; } //设为首页 on(release){ getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://www.maxfreshclub.com/');", "_self", "POST"; } on (release){
on (release) { getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage(你的网址');", "_self"); } “加入收藏” on(release) { getURL("javascript:window.external.AddFavorite('你的网址','站名')"); }
getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://16sucai.com');"); } 在<body>和</body>之间,加入以下代码: <A HREF=Javascript:></A> 一定要加!
on (release)
{ getURL("javascript:void(document.links.style.behavior='url(#default#homepage)');void document.links.setHomePage ('http://www.maxfreshclub.com')", "_self", "POST"); } 多种设为首页代码语法-在网页和FLASH中将您的网站设为首页
首先来说说如何在网页中将您的站点设为首页。
在网页中设为首页的常用代码语法: 1.文字链接型: 添加的代码语法为: 程序代码
<a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.maxfreshclub.com/');" href="#">设为首页</a> 2.按钮链接型: 添加的代码语法为: 程序代码
<input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.maxfreshclub.com//lovewall/);" href="#"> 3.图片链接型: 添加的代码语法为: 程序代码
<a style="cursor:hand" onclick="this.style.behavior='url(#default#homepage)'; this.setHomePage('www.wlzxy.com');"> <img width=16 height=16 border=0 src="图片地址"> <u> 设为首页</u></a> 4.离开时自动提示设为首页代码语法: 程序代码
<body onunload="BASEBody.style.behavior='url(#default#homepage)';if(!(BASEBody.isHomePage('http://www.maxfreshclub.com')))BASEBody.setHomePage('http://www.maxfreshclub.com/');"> 5.打开页面时自动弹出窗口询问是否设为首页代码语法: 先将以下JS代码放在<head></head>标签之间: 程序代码
<script language="javascript"> function myhomepage(){ this.homepage.style.behavior='url(#default#homepage)';this.homepage.sethomepage('http://www.maxfreshclub.com'); } </script> <p align="center"><a href="http://www.maxfreshclub.com/" name="homepage" onclick="myhomepage();"></a> 再将下面代码加入<body>标签内:
程序代码
onload="myhomepage();" 6.鼠标指向时提示设为首页代码语法: 将下列代码插入<body>标签中: 程序代码
<a href="http://www.maxfreshclub.com/" onmouseover="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.maxfreshclub.com/');" target="_blank">设为首页</a> -------------------------------------------------------------------------------
下面来说说在Flash中设为首页代码语法,毕竟现在Flash做站可是十分的流行呀,视觉效果很好。
1.用getURL的方法添加的代码语法: 在flash的按钮上添加以下代码语法即可: 程序代码
on (release) { getURL("javascript:void(document.links[0].style.behavior='url(#default#homepage)');void document.links[0].setHomePage('http://www.maxfreshclub.com/');", "_self", "POST"); } 2.用fscommand的方法添加的代码语法: 先在flash的按钮上添加如下代码语法: 然后在发布设置中选择flash with fscommand,发布成html,再修改html
找到 程序代码
// Handle all the the FSCommand messages in a Flash movie function sethomepage_DoFSCommand(command, args) { } 这一段,修改成:
程序代码
// Handle all the the FSCommand messages in a Flash movie function sethomepage_DoFSCommand(command, args) { var sethomepageObj = InternetExplorer ? sethomepage : document.sethomepage; if (command == "setHomePage") { document.links[0].style.behavior = "url(#default#homepage)"; document.links[0].setHomePage(args); } else if (command == "addFavorite") { args = args.split("|"); window.external.AddFavorite(args[0], args[1]); } } 最后,如果html文件里一个链接都没有,还需要在<Script language=JavaScript>这句的前面添加一句<a href="javascript:"></a>
目前个人所了解的常用的就这么多了,如果您有更好的方法,也欢迎您的指教。
|