zoukankan
html css js c++ java
修改动网新闻.net
1、裁减首页调用图片的尺寸。
如果直接设置
<
script type
=
"
text/javascript
"
>
var
thumbWidth
=
160
;
var
thumbHeight
=
0
;
var
thumbHWidth
=
160
;
var
thumbHHeight
=
0
;
</
script
>
中的thumbHHeight值的话,万一有比例不合适的图片的话显示出来的图片很难看了。为了显示得比例好看,在/inc/thumbnail.js中添加
function
WriteThumb(img,url,alt,blank,highlight)
{
if
(blank
==
null
)
blank
=
false
;
if
(highlight
==
null
)
highlight
=
false
;
with
(document){
write(
"
<table class='thumbnail'>
"
);
write(
"
<tr><td style='overflow:hidden;'>
"
);
//
下面<div>定义了首页调用图片文件的时候图片框的大小,overflow:hidden表示剪切超出图片框的部分
write(
"
<div style='overflow:hidden;160px;height:120px;'>
"
);
write(
"
<a href='
"
);
write(url);
if
(blank)
write(
"
' target='_blank'>
"
);
else
write(
"
'>
"
);
write(
"
<img src='
"
);
write(img);
write(
"
' alt='
"
);
write(alt);
write(
"
'
"
);
if
(highlight){
if
(thumbHWidth
>
0
){
write(
"
width='
"
);
write(thumbHWidth);
write(
"
'
"
);
}
if
(thumbHHeight
>
0
){
write(
"
height='
"
);
write(thumbHHeight);
write(
"
'
"
);
}
}
else
{
if
(thumbWidth
>
0
){
write(
"
width='
"
);
write(thumbWidth);
write(
"
'
"
);
}
if
(thumbHeight
>
0
){
write(
"
height='
"
);
write(thumbHeight);
write(
"
'
"
);
}
}
//
在这里加上</div>
write(
"
></a></div></td></tr></table>
"
);
}
}
这样图片就安装预设的尺寸裁减了,看起来效果好多了。
2、友情连接
不能把友情连接全部删除后再添加,这样会出错,可能是一个bug把。
查看全文
相关阅读:
【整理】在一亿个数中寻找出现频率最多的4个
【整理】静态页面提交数据
使用SIlverlight 4.0开发时,遇到提示"...Missoft.Silverlight.CSharp.Targets"文件路径不对的解决办法
关于vs2010服务器资源管理器再添加数据连接时无法获取服务器名的解决办法
关于Silverlight角色扮演游戏Sprite经典属性设计
[学习笔记]Silverlight+WCF对数据库进行操作
【学习】Silverlight中读取XML文件
TCP/IP之UDP协议
Tornado Prespective(转)
TCP/IP之IP选路及动态选路
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
IIS7对于IIS6的改进及配置系统的差异
SQL SERVER 2005 基于证书的镜像配置步骤
Difference between node and element in xml
利用标签(Attribute)和Microsoft.Practices.ObjectBuilder构造对象实例
漂泊人生
在ASP.NET中使用SqlServer Reporting Service样例
眼睛保护程序
WP7在使用后台计划任务代理的时候要注意的地方
数据字节单位
MVVM设计模式之精髓简化
热门文章
JSON数据查看工具
XAML Namespace http://schemas.microsoft.com/expression/blend/2008 is not resolved
【摘录】DataView过滤操作符
【转载】VS2008无法调试,可以执行,但就是不能命中断点
【原创】定义游标时使用动态SQL语句
【原创】表驱动法的使用举例及优越性体现
【整理】更改Web.config中对上传文件大小限制
【原创】asp.net静态页面生成方案
【整理】关于Access批量插入数据
【原创】C#实现列表绑定
Copyright © 2011-2022 走看看