首先,插入一下代码到页头文件中:
<script src="qybi/js/hdp1.js" type="text/javascript"></script>
<script src="qybi/js/hdp2.js" type="text/javascript"></script>
<script type="text/javascript">
var moveStyle
var rand =parseInt(Math.random()*4)
switch(rand){
case 0: moveStyle="left" ;break;
case 1: moveStyle="right" ;break;
case 2: moveStyle="down" ;break;
case 3: moveStyle="up" ;break;
}
$(function(){
$("#KinSlideshow").KinSlideshow({TitleFont_size:16,moveStyle:moveStyle,mouseEvent:"mouseover"});
})
</script>
然后在需要调用首页焦点图的地方添加以下调用代码:
然后在需要调用首页焦点图的地方添加以下调用代码:
<div id="KinSlideshow" style="visibility:hidden;">
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="8"}
{loop $data $r}
<a href="{$r['url']}" target="_blank"><img src="{thumb($r['thumb'],320,240)}" alt="{$r['title']}" width="320" height="240" /></a>
{/loop}
{/pc}
</div>