当前位置:首页 > 未命名

zblog调用幻灯片代码

8976988823个月前 (01-10)未命名5

现在大多网站都有幻灯片效果,有一个好看的幻灯片,能给网站添色不少。

不管JS、还是Jquery,添加到zblog上都要自己动手了,CSS样式自已去修改成你想要的!

自己整理了个代码,记录下来方便以后使用。

代码如下:

<ul class="slider-relative" id="relative">{php}    $array = explode(',',$zbp->Config('sml_cms')->indexflash);{/php}{foreach $array as $hotid}    {$related=GetPost((int)$hotid)}    <li class="slide fix-width"><a href="{$related.Url}" target="_blank">     <img src="{php}$temp=mt_rand(1,5);$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";$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}" /></a> <span class="text ani-left"><strong><a href="{$related.Url}" target="_blank">{$related.Title}</a></strong><small><a href="{$related.Url}" target="_blank">{php}$intro= preg_replace('/[\r\n]+/', '', trim(SubStrUTF8(TransferHTML($related->Content,'[nohtml]'),30)).'...');{/php}{$intro}</a></small></span></li>{/foreach}</ul>


扫描二维码推送至手机访问。

版权声明:本文由米表程序发布,如需转载请注明出处。

本文链接:https://www.9909999.xyz/post/615.html

分享给朋友: