时间:2021-07-01 10:21:17 帮助过:7人阅读
代码如下:
var titles = '创顶1|创顶2|创顶3|创顶4';
var imgs='{APP_PATH}cdstyle/images/image1.jpg|{APP_PATH}cdstyle/images/image2.jpg|{APP_PATH}cdstyle/images/image3.jpg|{APP_PATH}cdstyle/images/image4.jpg';
var urls='http://baby220818.gotoip2.com/|http://baby220818.gotoip2.com/|http://baby220818.gotoip2.com/|http://baby220818.gotoip2.com/';
只能识别这种,今天我们就解决这样的问题,下边就是我的思想和代码
代码如下:
var title = new Array(); //先申明数组 全部加载到数组中
var img = new Array();
var url = new Array();
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"}
{php $a=1;}
{loop $data $r}
title[{$a}] = "{$r['title']}"; //title[1]='heloo'
img[{$a}] ="{thumb($r['thumb'],295,225)}";
url[{$a}] ="{$r['url']}";
{php $a++;}
{/loop}
{/pc}
var files = "";
var links = "";
var texts = "";
for(i=1;i
else files += "|"+img[i];
}
for(i=1;i
else links += "|"+url[i];
}
for(i=1;i
这个其实很简单,主要就是思维上边的问题。