官方首页 | 无图版 | BBS首页
PJBlog3 2.8.5.157 新版发布 下载|升级(2008.8.26) 大话PJ3 | PJ3评测反馈 | PJ3发展建议 PJ纪念版T-shirt设计大赛投票结束大奖揭晓! PJ3内测团队主创人员身份,性格,特点吐血大曝光
PJBlog技术支持论坛使用问题总索引 PJ-Blog 3 斑竹日志 【独家】我使用过的三种空间,与客服的精彩故事 Z-Blog,Wordpress,Bo-Blog转换到PJBlog
 12 12
发新话题
打印

Blog网页右下角书签图片修改For PJBlog2

本主题由 thomas 于 2007-3-20 14:38 解除高亮

Blog网页右下角书签图片修改For PJBlog2

这个效果在很多国外的Blog比较流行,于是自己仿照着做了一个,没什么技术含量,只是要修改PJBlog的源文件header.asp,请大家在修改前注意备份。
本效果功能特点是:
1. PNG透明图片,支持Firefox、IE6、IE7。
2. 收藏夹功能,支持Firefox、IE6、IE7。
3. 跟随页面滚动,位置不变。


效果比较难表达,请直接看演示:http://bigik.cn/blog
有其他问题可以到博客原帖留言、教程链接:http://bigik.cn/blog/article.asp?id=229
  希望大家喜欢~

修改方法:

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


2. 打开你Blog根目录下面的header.asp文件

3. 找到</head>标签,在其上面加入以下代码(其中收藏夹功能的网址和名称可自己修改):
复制内容到剪贴板
代码:
<script language="javascript">
<!--
function addFavorite()
{
<%
if inStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then
%>
window.external.AddFavorite('http://www.bigik.cn/', 'Bigik.cn 大头与饼仔');
<%
elseif inStr(Request.ServerVariables("HTTP_USER_AGENT"),"Firefox") then
%>
window.sidebar.addPanel('大头与饼仔', 'http://www.bigik.cn/', "Bigik.cn 大头与饼仔");
<%
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: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/TooCoo.png');
}
-->
</style>
4. 找到<body  >或者<body>标签,在其下面加入以下代码:
复制内容到剪贴板
代码:
<A href="javascript:addFavorite()" id="TooCoo">www.bigik.cn</a>
[ 本帖最后由 bigheadlyf 于 2007-2-23 13:06 编辑 ]

TOP

不错

[ 本帖最后由 shinian10 于 2007-2-23 13:26 编辑 ]
http://www.shinian10.com  十年博客,有技术没约束

TOP

有一个问题 按照方法修改成功了 但是添加成功后的页面使用 the world 2.0浏览器无法输入文字了 比如无法点击搜索框 无法输入回复的昵称等

[ 本帖最后由 ekingsky 于 2007-2-23 15:53 编辑 ]

TOP

有个问题,IE6不支持PNG透明效果的好像要加个滤镜?

TOP


我就是IE6的
怎么可以

TOP

很不错!

TOP

用了,但是在IE下边的状态栏里显示了
行:1
char:1
错误:缺少对象
代码:0
url:http://bigik.cn/blog/

这个不关浏览器的事吧,请楼主检查一下代码.

还有,页面无法选中文字了.

TOP

经过我的测试,解决页面出错和无法选中的问题.修改代码如下,其实,就是把!important去掉

<script language="javascript">
<!--
function addFavorite()
{
<%
if inStr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then
%>
window.external.AddFavorite('http://www.bigik.cn/', 'Bigik.cn 大头与饼仔');
<%
elseif inStr(Request.ServerVariables("HTTP_USER_AGENT"),"Firefox") then
%>
window.sidebar.addPanel('大头与饼仔', 'http://www.bigik.cn/', "Bigik.cn 大头与饼仔");
<%
end if
%>
}
-->
</script>
<style type="text/css">
<!--
a#TooCoo
{
        position:fixed;
        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 ;
        text-indent: -999em;
        text-decoration: none;
        z-index:99;
        background-image: url();
        filter: progidXImageTransform.Microsoft.AlphaImageLoader(src='images/TooCoo.png');
}
-->
</style>

TOP

如楼上所说 去掉!important 就开始抖动了 这里要用fixed属性才能真正固定

TOP

出现抖动的话,应该怎么解决呢?

TOP

 12 12
发新话题