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把。
查看全文
相关阅读:
分布式文件系统
分布式系统中的CAP理论
安装Elasticsearch-header插件
Elasticsearch 安装
分布式搜索引擎-ES
高可用集群架构 Keepalived 双机主备和双主热备
先阶段部署架构
技术人员的两个发展方向
input标签写CSS时需要注意的几点(先收藏)
如何设置box shadow的透明度
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
Transport Ship
可怜的神水
方格填色
漂亮的公园
牛客练习赛26
Trace
GDY
AC Challenge
P3649 [APIO2014]回文串
错误cnt
热门文章
Gym 101002I Tourists LCA板子题
Codeforces Round #565 (Div. 3) A-F题解
1174 D. Ehab and the Expected XOR Problem异或 构造
Codeforces Round #442 (Div. 2) B.Nikita and string
Educational Codeforces Round 32 D. Almost Identity Permutations
转(吴翼)吴老师的ACM之路
Educational Codeforces Round 65 (Rated for Div. 2) A-F解题报告
莫队算法学习记录
Codeforces Round #560 (Div. 3) A-F解题报告
FastDFS 分布式文件系统
Copyright © 2011-2022 走看看