admin管理员组

文章数量:1516870

为方便初学者,将多媒体版我以前回答过的加入收藏夹的简单方法和样式总结如下:

左键弹出收藏夹:
<script language=JavaScript1.2>
if (document.all)
document.body.onmousedown=new Function("if (event.button==0||event.button==1)window.external.addFavorite(')")
</script>

右左键都可弹出收藏夹:
<script language=JavaScript1.2>
if (document.all)
document.body.onmousedown=new Function("if (event.button==1||event.button==2)window.external.addFavorite(')")
</script>

右键打开收藏夹,左键无效:
<script language=JavaScript1.2>
if (document.all)
document.body.onmousedown=new Function("if (event.button==2||event.button==3)window.external.addFavorite(')")
</script>

文字加入收藏夹:
<script language="JavaScript">
function bookmarkit(){window.external.addFavorite(')}//改为你自己的网址和站名
if (document.all)document.write('<a href="#" onClick="bookmarkit()">加入收藏夹</a>')
</script>
or
<A href="javascript:window.external.addfavorite(')">收藏本站</A>

按钮加入收藏夹:
<input onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹>
<!--   若用CSS控制 -->
<input style="BORDER-RIGHT: 2px outset; BORDER-TOP: 2px outset; BORDER-LEFT: 2px outset; COLOR: #f7f7e7; BORDER-BOTTOM: 2px outset; BACKGROUND-COLOR: #6b696b"  onclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹>

图片按钮实现:
<A href="javascript:window.external.AddFavorite(')"><IMG alt=添加至收藏夹 src="image/1234.gif" align=absBottom border=0 >

无变化加入收藏夹:
<TABLE class=fsdtb1 cellSpacing=0 cellPadding=0 border=0>
<TD  onclick="window.external.AddFavorite(')">加入收藏</TD>
</TABLE>

本文标签: 藏夹收藏夹编程