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把。
查看全文
相关阅读:
git 操作
vim使用指北 ---- Multiple Windows in Vim
Unity 异步网络方案 IOCP Socket + ThreadSafe Queue
unity 四元数, 两行等价的代码
golang的项目结构 相关知识
stencil in unity3d
一段tcl代码
16_游戏编程模式ServiceLocator 服务定位
15_游戏编程模式EventQueue
14_ Component 游戏开发组件模式
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
在一个字符串中找到第一个只出现一次的字符(java实现)
关于内连接和外连接(待补充)
云仓库地址
liferay7-Gradle的使用
liferay7 java 利用JAX-RS快速开发RESTful 服务
liferay7-rest开发JAX-RS规范详解
liferay7 rest服务创建
EL-ADMIN前后端分离的后台管理系统
liferay7 中模板中直接调用服务
Liferay中通过Webservice发布网页内容文章
热门文章
liferay7悬浮框
liferay7如何获取片段的地址例如webcontent
ubuntu i3 xterm中文输入显示问题解决
ubuntu vim markdown 实时预览
ubuntu docker方式部署docker registry v2
docker 安装 gogs(go git server) 及问题解决
ubuntu14.04 server 安装docker
Ubuntu Tomcat
Ubuntu ssh 代理
全网访问速度优化
Copyright © 2011-2022 走看看