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把。
查看全文
相关阅读:
mongodb
winform最小化到托盘
C# 多线程实例化 定时执行 实例化线程 刷新控件
如何弹出一个模式窗口来显示进度条
如何使自己的程序只运行一次
Form窗体点击关闭按钮并未关闭进程的解决方法
如何用C#写一个简单的Login窗口
C#操作IIS添加MIME类型(win2003)
天天学习WPF
如何注册dll文件
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
jQuery select 操作。
那种高速交易是怎么做到的?
CyanogenMod
获取其他进程Listctrl的数据
java q
SSE
Solar wafer inspection equ.
jQuery & highcharts
类C编译器
fltk试用 (1)
热门文章
pathon math lib
光刻
风魂”
分布式文件系统
vmware tools
qt 试用 (1)
MFC program chinese UI
List of World’s Top Solar Wafer Companies – Growing Bigger
python debugger
某unix招聘说明
Copyright © 2011-2022 走看看