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把。
查看全文
相关阅读:
个人亲历运维面试
《Kubernetes进阶实战》之管理Pod资源对象
Docker容器必备技能 -- iptables
vue后台管理权限正确思路
Axios 各种请求方式传递参数格式
Cookie的使用(js-cookie插件)
微信小程序template模板与component组件的区别和使用
如何机智地回答浏览器兼容性问题
webpack系列5:源码流程,webpack编译流程
webpack系列4:文件分析.
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
重新来过~~字符串
Dinic算法——重述
回归——继续我的ACM之路!!
Python_base_字符串、切片
python_base_时间戳和日期相互转换
Pycharm 快捷键、小技巧
python_input
测试框架封装之unittest
WebDriver API --8种定位方式
Python_base_04 异常捕捉
热门文章
Python_base_03 导包
Python_base_02 类、函数、方法和对象
Python_base_01 列表、元组和字典
Golang之基于Linux开发环境
nsenter命令简介
Kubernetes之Deployment控制器
<5>Python开发——字典
prometheus之tar包部署
个人亲历运维面试
Mysql常用查询
Copyright © 2011-2022 走看看