php中有关smarty的问题 本帖最后由 hatzhou 于 2011-04-05 21:09:42 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给图片一个具体的ID呢,或者把图片放在DIV中,DIV的ID可以赋值:DIV_1,DIV_2,DIV_3........然后用JS亦或JQUERY操作这些ID实现具体的效果呢,本人觉得用JQUERY更方便些 <script language="javascript">var widths=312; var heights=170; //var counts=5;<?{foreach from=$arr|api:'news':'getInfoList':"where thumbnail^ ORDER BY topflag DESC,submit_date DESC^0^5^id,title,submit_date,thumbnail,bedeck,summary^^0" name=InfoList item=arrNewsList}?>{math equation="total + 1" assion="index" total=$smarty.foreach.InfoList.total}img<?{$index}?>=new Image ();img<?{$index}?>.src=<?{$arrNewsList.thumbnail}?>">; // 你确定不是a标签吗?url<?{$index}?>=new Image ();url<?{$index}?>.src='<?{if $arrNewsList.linkurl!=''}?><?{$arrNewsList.linkurl}?><?{else}?><?{url url = "/news/detail.php?id=`$arrNewsList.id`" cache = "`$arrGWeb.file_static`"}?><?{/if}?>';<?{/foreach}?>var counts=<?{$smarty.foreach.InfoList.total}?>;// 下面省略</script> 楼上 你说如果把循环出来的图片放在一个数组里的话下面的图片地址直接 这样引用 img1=new Image ();img1.src='$arr[0]'; img2=new Image ();img1.src='$arr[1]'; .....这样行吗 尝试了一下 失败了 可能是我做的不对 怎样呢 在国外可以访问国内的网站吗? PHP jQuery 1.4.4 url的参数值可以用何方式加密或改变显示? 匹配中括号中的内容的正则 ASP的COOKIE能不能和PHP的COOKIE互通叱。。。 小问题,,大给分,,快近来看看! 熬夜了,天亮了,送分了, php存到数据库好象对某些字的支持有问题,不知是知原因. 学PHP MYSQL是不是必学LINUX? xdebug和zend debug安装问题 同样的一段代码,放入函数内和不放入函数内,结果就不一样了 循环添加,数据丢失!!!!!
DIV_1,DIV_2,DIV_3........
然后用JS亦或JQUERY操作这些ID实现具体的效果呢,本人觉得用JQUERY更方便些
var widths=312;
var heights=170;
//var counts=5;<?{foreach from=$arr|api:'news':'getInfoList':"where thumbnail^ ORDER BY topflag DESC,submit_date DESC^0^5^id,title,submit_date,thumbnail,bedeck,summary^^0" name=InfoList item=arrNewsList}?>
{math equation="total + 1" assion="index" total=$smarty.foreach.InfoList.total}img<?{$index}?>=new Image ();img<?{$index}?>.src=<?{$arrNewsList.thumbnail}?>">;
// 你确定不是a标签吗?
url<?{$index}?>=new Image ();url<?{$index}?>.src='<?{if $arrNewsList.linkurl!=''}?><?{$arrNewsList.linkurl}?><?{else}?><?{url url = "/news/detail.php?id=`$arrNewsList.id`" cache = "`$arrGWeb.file_static`"}?><?{/if}?>';<?{/foreach}?>var counts=<?{$smarty.foreach.InfoList.total}?>;// 下面省略
</script>
下面的图片地址直接 这样引用
img1=new Image ();img1.src='$arr[0]';
img2=new Image ();img1.src='$arr[1]';
.....
这样行吗 尝试了一下 失败了 可能是我做的不对 怎样呢