<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

DEDECMS列表页随机调用多张缩略图

时间:2020-12-15

DEDECMS列表页面调用缩略图,可以用系统自带的脚本调用第一张图片,也可以通过修改或者自定义织梦函数,来随机调用多张自备缩略图里的一张。

缩略图随机调用代码:

1、默认调用缩略图的代码:

 [field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<a href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a>"); [/field:array]

2、替换成如下的代码:

 <a href="[field:arcurl/]" title="[field:title/]" target="_blank"><script language="JavaScript" src="/images/road.js"></script></a>

3、把JS文件和准备好的随机缩略图片,上传到网站的images目录里。

var m=20; 

var n=Math.floor(Math.random()*m+1) 

document.write ("<img src='http://www.dedecms8.com/images/nt"+n+".jpg' border=0 width=148 height=118 />");  

注意:最好准备20-30张固定缩略图尺寸的图片,不会重复太多,版面比较好看。

0
首页
案例
关于
联系