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把。
查看全文
相关阅读:
nyoj_216_A problem is easy_201312051117
nyoj_676_小明的求助_201312042142-2
C# 堆和栈的区别?
DataReader和DataSet区别
SQLSERVER2008R2正确使用索引
SQL Profiler工具简介
(转)非常完善的Log4net详细说明
SQL语句优化技术分析
HashTable、HashSet和Dictionary的区别
使用Nuget发布自己的类库包
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
Python竟然能让王者荣耀血亏?
Python爬虫——白嫖小说最高境界!
Python 也能开发 App ?
用了五年flask,居然比不过用了五分钟的“它”!
Python爬取小姐姐内衣信息,寻找妹纸们的偏好
终极大招完美结合Excel与Python!(零基础就能学)
瞬间“友尽”的五大整蛊代码,快去坑你的小伙伴吧!
nyoj_171_聪明的kk_201402281518
nyoj_212_K尾相等数_210402272239
ACM数论总结
热门文章
nyoj_915_+-字符串_201402261520
nyoj_448_寻求最大数_201402261424
nyoj_91_阶乘之和_201312131321
nyoj_85_有趣的数_201312122130
nyoj_71_独木舟上的旅行_201312122051
nyoj_478_月老的烦恼(1)_201312101248
hdu_1285_确定比赛名次_201312081335
nyoj_782_星期几?_201312071940
nyoj_18_The Triangle_201312071533
nyoj_283_对称排序_201312051155
Copyright © 2011-2022 走看看