Fix phpcms change javascript slide code call picture problem, Phpcmsjavascript
Today found a JS to put on the top of PHPCMS! But his code is like this.
Copy the Code code as follows:
var titles = ' Create top 1| top 2| Create top 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/';
Can only recognize this, today we solve this problem, below is my thought and code
Copy the Code code as follows:
var title = new Array (); First, declare that the array is loaded into the 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;iif (files== ") files = Img[i];//If files= null is assigned files = = Img[1] Then +| +img[2] The top format will be output at the end.
else files + = "|" +img[i];
}
for (i=1;i<>
if (links== ") links = url[i];
Else links + = "|" +url[i];
}
for (i=1;i<>
if (texts== "") texts = title[i];
else texts + = "|" +title[i];
}
var titles = texts; Assign value
var imgs= files;
var urls=links;
This is actually very simple, mainly is the problem of thinking above.
http://www.bkjia.com/PHPjc/933599.html www.bkjia.com true http://www.bkjia.com/PHPjc/933599.html techarticle solve phpcms change javascript slide code call picture problem, Phpcmsjavascript today found a JS to put on PHPCMS top! But his code is such a copy code code like ...