瀑布流栏目骨架
一个栏目设计一个表,表里分别是,自增id、img地址、content
复制配置,改下表名、前缀
<!DOCTYPE html> <head> <style> .wfc { left: -200px; top: 1000px; -webkit-transition: opacity .4s ease-in-out; -moz-transition: opacity .4s ease-in-out; -o-transition: opacity .4s ease-in-out; margin-right:40px; margin-top:40px; float:left } .pin { width: 236px; font-size: 12px; background-color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); -moz-box-shadow: 0 1px 3px rgba(0,0,0,.3); -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.3); margin-right:40px; margin-top:40px; float:left } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>纯CSS实现的波浪形菜单效果_脚本分享网</title> <link rel="stylesheet" href="__ROOT__/Index/Tpl/tpl/dhcss/style.css" type="text/css" media="screen" /> </head> <body> <div class="navi1"> <ul> <li class="sm1"><a href="{:U('Index/searchchia')}"></a></li> <li class="sm2"><a href="http://sc.chinaz.com"></a></li> <li class="sm3"><a href="http://sc.chinaz.com"></a></li> <li class="sm4"><a href="http://sc.chinaz.com"></a></li> <li class="sm5"><a href="http://sc.chinaz.com"></a></li> </ul> </div> <HR style="FILTER: progid:DXImageTransform.Microsoft.Glow(color=#987cb9,strength=10)" width="80%" color=#987cb9 SIZE=1> <foreach name="div" item="vo"> <div data-id="43460131" data-seq="43460131" data-source="weibo.com" data-created-at="1359428707" class="pin wfc "> <img src="{$vo.img}" width="236" height="355" alt="Div采集到55"> <p>{$vo.content}</p> </div> </foreach> </body> </html>
控制器里就几句话
<?php // 本类由系统自动生成,仅供测试用途 class IndexAction extends Action { public function index(){ $this->display(); } public function searchchia(){ header("Content-Type:text/html; charset=utf-8"); $Biao = M("China"); // 实例化模型类 $div = $Biao->select(); $this->assign('div',$div); $this->display(index); } }
栏目地址对应控制器方法