主题:  [推荐]个性展示,网页右下角添加书签代码插件!

yiyacn

职务:普通成员
等级:1
金币:0.0
发贴:4
注册:2007/3/6 11:47:29
#12007/3/17 11:25:43
在挺多的国外网站在看到过,国内的大头BLOG也看到过,效果看上去都挺好,所以反代码整理出来提供给大家使用,我站以使用。大家可以看首页。

演示:


网站效果演示:
www.yiyacn.com


效果功能特点是:
1. PNG透明图片,支持Firefox、IE6、IE7。
2. 收藏夹功能,支持Firefox、IE6、IE7。
3. 跟随页面滚动,位置不变。




添加方法:

1. 制作一张你自己喜欢的PNG图片,保存到images文件夹下,文件名为TooCoo.png,例如:

(保存该图,然后用软件打开,把字改一下就OK!)

2. 打开你需要添加标签的文件/如果你是模板,可以加在对应模板里。

3. 找到</head>标签,在其上面加入以下代码(其中收藏夹功能的网址和名称可自己修改):

程序代码
<script language="javascript">
<!--
function addFavorite()
{
<%
if inStr(Request.ServerVariables("HTTP_USER_AGENT","MSIE" then
%>
window.external.AddFavorite('http://www.yiyacn.com/', 'YiYaCn.com 艺雅中国');
<%
elseif inStr(Request.ServerVariables("HTTP_USER_AGENT","Firefox" then
%>
window.sidebar.addPanel('艺雅中国', 'http://www.yiyacn.com/', "'YiYaCn.com 大头与饼仔";
<%
end if
%>
}
-->
</script>
<style type="text/css">
<!--
a#TooCoo
{
position:fixed!important;
position:absolute;
right: 0;
bottom: 0;
Top: expression(offsetParent.scrollTop + offsetParent.clientHeight - 96);
display: block;
height: 96px;
width: 96px;
background: url(images/TooCoo.png) bottom right no-repeat !important;
text-indent: -999em;
text-decoration: none;
z-index:99;
background-image: url();
filter: progidXImageTransform.Microsoft.AlphaImageLoader(src='images/TooCoo.png');
}
-->
</style>


4. 找到<body>标签,在其下面加入以下代码:

程序代码
<A href="javascript:addFavorite()" id="TooCoo">www.yiyacn.com</a>

OK!一切搞定,回到页面中去看看效果吧。

如果您还不会,请在我站留言处留言或到论坛发贴,我会帮你理解的,毕竟来动易的时间有限,在自已的网站多一点。有必要的话请留下QQ,但还是希望大家多学多试,这样才会有提高。