幻灯片是网站不可少的元素,有一个好看的幻灯片,能给网站添色不少。
不管JS、还是Jquery,添加到zblog上都要自己动手了。
自己整理了个代码,记录下来方便以后使用。
代码如下:
{php}
$array = explode(',',$zbp->Config('sml_cms')->indexflash);
{/php}
{foreach $array as $hotid}
{$related=GetPost((int)$hotid)}
/";
$content = $related->Content;
preg_match_all($pattern,$content,$matchContent);
if(isset($matchContent[1][0]))
$temp=$matchContent[1][0];
else
$temp="$host/zb_users/theme/$theme/style/images/random/$temp.jpg";
{/php}{$temp}" alt="{$related.Title}" />
{/foreach}
代码配合Jquery实际效果如下图:
现在网上好多Jquery图片效果,找个好看的,配合代码就能做出一个好看的幻灯片来。