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把。
查看全文
相关阅读:
Ubunut16.04 安装 Theano+GPU
ubuntu源与常用python配置pip源(win)、pip常用命令
集群(heartbeat)搭建
Linux下搭建企业共享目录方案之------samba
LAMP的安装和注意事项
Linux最小化安装,忘记安装开发工具的解决方法
去掉Linux尖锐的提示音
最小化安装CentOS7,没有ifconfig命令---yum search command_name搜索未知包名
编译安装php-5.4.44
configure: error: Please reinstall the libcurl distribution
原文地址:https://www.cnblogs.com/pupil/p/142849.html
最新文章
mui初级入门教程(六)— 模板页面实现原理及多端适配指南
mui初级入门教程(五)— 聊聊即时通讯(IM),基于环信 web im SDK
mui初级入门教程(四)— 再谈webview,从小白变“大神”!
输入一个URL到页面呈现其中发生的过程-------http过程详解
margin外边距合并问题以及解决方式
cookie和session的区别异同
标准模式和混杂模式下浏览器的可视区域的宽高问题
瀑布流布局
Web worker 与JS中异步编程的对比
JS中的bind的实现以及使用
热门文章
JS中的异步以及事件轮询机制
JS中有关对象的继承以及实例化、浅拷贝深拷贝的奥秘
onchange、oninput、onpropertyChange事件的异同
Ubuntu配置zsh
国内npm源
Maven国内源设置
关于docker安装、docker镜像、docker容器等
使用setup.py安装python包和卸载python包的方法
国内外开源镜像服务器站点汇总
Ubunut16.04 安装 g++ gcc 降级
Copyright © 2011-2022 走看看