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把。
查看全文
相关阅读:
常用模块——time模块,datetime模块
开发目录的规范
包
模块
day17作业
面向过程编程
函数递归
谈谈作为一个菜B的培训感受
絮叨机房精密空调的制冷剂
接入机房产生冷凝水
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
cf723d Lakes in Berland
cf723c Polycarp at the Radio
cf723b Text Document Analysis
cf723a The New Year: Meeting Friends
LYDSY模拟赛day1 Walk
LYDSY模拟赛day1 Tourist Attractions
LYDSY模拟赛day1 String Master
带 sin, cos 的线段树
sin 与 cos 的用法
数字任意组合
热门文章
2次方的期望dp
3次方的期望dp
牛客网暑期多校训练营第六场
牛客暑期ACM多校 第七场
数据的随机性
快速乘
wannafly camp day4
常用模块——sys模块
常用模块——random模块
day19作业
Copyright © 2011-2022 走看看