From c0f86e6012a35dd36e8e870e22218efa8f80d82a Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 10 Apr 2013 08:47:05 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86jquery.masonry?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=BC=A9=E7=95=A5?= =?UTF-8?q?=E5=9B=BE=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 2 +- .../default/views/scripts/data/thumb.phtml | 80 +++++++++++-------- application/models/Theme.php | 8 +- htdocs/css/water.css | 44 ++++------ htdocs/js/lib/jquery.masonry.min.js | 10 +++ 5 files changed, 77 insertions(+), 67 deletions(-) create mode 100644 htdocs/js/lib/jquery.masonry.min.js diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index dbd6920e..0382c384 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1679,7 +1679,7 @@ class DataController extends Zend_Controller_Action $sum=$row[0]['count']; $select=$this->db->select(); $select->from('normalmetadata as m','m.*') - ->order('m.title desc')->limitPage($page,$this->limit); + ->order('m.title desc')->limitPage($page,9); $this->view->metadata = $this->db->fetchAll($select); $this->view->page=new Pagination($sum,$page,$this->limit); } diff --git a/application/default/views/scripts/data/thumb.phtml b/application/default/views/scripts/data/thumb.phtml index 9ba465ed..9c05a4e2 100644 --- a/application/default/views/scripts/data/thumb.phtml +++ b/application/default/views/scripts/data/thumb.phtml @@ -1,36 +1,46 @@ -headTitle($this->config->title->site); -$this->headTitle($this->config->title->data); -$this->headTitle('缩略图浏览'); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/water.css'); -$this->breadcrumb('首页'); -$this->breadcrumb(''.$this->config->title->data.''); -$this->breadcrumb('缩略图浏览'); -$this->breadcrumb()->setSeparator(' > '); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); -$this->headScript()->appendFile('/js/jquery.colorbox-min.js'); -$this->headLink()->appendStylesheet('/css/colorbox.css'); -?> - -page->getNavigation(); ?> -
-
-metadata as $md) : ?> - - -
-
-page->getNavigation(); ?> - - \ No newline at end of file diff --git a/application/models/Theme.php b/application/models/Theme.php index b4886b31..8cd9a5c8 100644 --- a/application/models/Theme.php +++ b/application/models/Theme.php @@ -98,7 +98,13 @@ class Theme $this->CSSKey => array( '/js/lib/jquery.datatable/datatable.css' ) - ), + ), + + 'masonry' => array( + $this->ScriptKey => array( + '/js/lib/jquery.masonry.min.js' + ), + ), /*********谷歌地图*********/ diff --git a/htdocs/css/water.css b/htdocs/css/water.css index bbb555b2..81021573 100644 --- a/htdocs/css/water.css +++ b/htdocs/css/water.css @@ -12,7 +12,6 @@ /* used in water */ .PageNavigation{padding-left:30px;} hr{border: none 0;border-bottom:1px dashed #ccc;height: 1px;width:100%;margin:0;padding:5px 0 5px 0;} -li {white-space:nowrap;} #mdlist{} #mdlist span{width:80%;} #mdlist ol li{white-space:normal;} @@ -30,7 +29,7 @@ ul{list-style-type: none;margin:2px 5px 2px 20px;} /* used in search*/ .mditem{clear:left;text-indext:2em;padding:5px;} .mditem hr{clear:both;padding:0;} -.thumb {float:left;padding-right:5px;height:220px;overflow:hidden;margin-left:5px;} +/*.thumb {float:left;padding-right:5px;height:220px;overflow:hidden;margin-left:5px;}*/ #search{} .float{float:left;} @@ -104,31 +103,16 @@ ol,ol li{list-style:decimal;margin-left:20px;} font-size:12px;font-weight:bold;color:#00A9FF;white-space: normal;} .singleline img{height:20px;vertical-align:middle;} -#tabs-controller {overflow:hidden;padding:5px 0;margin:5px 0px;} -#tabs-controller ul li{float:left;padding:3px 10px;border:1px solid #93bee2;border-radius:5px;margin:0 5px;} -#tabs-controller ul li:hover{background:#f1f8fe;} -#tabs-controller ul li.active{background:#e8f4ff;} - -.bigtitle{font-size:14px;font-weight:bold;line-height:24px;text-indent:14px;background:url(/images/arrow_red_10x10.gif) 0 center no-repeat;} -.bigtitle a{color:#004411;} -.box-shadow{ - box-shadow:2px 2px 2px #ccc; - -webkit-box-shadow:2px 2px 2px #ccc; - -moz-box-shadow:2px 2px 2px #ccc; - filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=125, Color='#cccccc'); - -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=3, Direction=125, Color='#cccccc')"; -} -.text-shadow{ - text-shadow:#ccc 2px 2px 2px; -} - -#datalist{overflow:hidden;} -#datalist h2{margin-left:20px;} -#datalist ul li{margin:5px 0px;padding:5px 0px;background:#f6f6f6;border:1px solid #FFF;border-radius:3px;} -#datalist ul li:hover,#datalist ul li:focus{border:1px solid #ccc;background:#fefefe;} -#datalist ul li a{font-size:12px;} -#datalist ul li a.title{font-size:14px;} -#datalist ul li a.more{font-size:12px;} -#datalist ul li p{text-indent:24px;font-size:12px;line-height:24px;} -#datalist ul li p img {vertical-align:middle;} -.search_form{margin-left:20px;float:none;} \ No newline at end of file +.row-fluit{overflow:hidden;} +.thumb{overflow:hidden;} +.thumb li {width:320px;float:left; margin:10px 20px; overflow:hidden;border: 1px solid #DDDDDD; + border-radius: 4px 4px 4px 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.055); + display: block; + line-height: 20px; + padding: 4px; + transition: all 0.2s ease-in-out 0s;} +.thumb li .thumbnail{width:80%;height:220px; overflow:hidden;display:block; margin:5px auto;padding:2px;border:none;} +.thumb li img{width:100%;} +.thumb li h4{ position:relative;top:0;height:40px;} +.thumb li p{word-break:break-all;word-wrap:break-word;} \ No newline at end of file diff --git a/htdocs/js/lib/jquery.masonry.min.js b/htdocs/js/lib/jquery.masonry.min.js new file mode 100644 index 00000000..57c081c6 --- /dev/null +++ b/htdocs/js/lib/jquery.masonry.min.js @@ -0,0 +1,10 @@ +/** + * jQuery Masonry v2.1.08 + * A dynamic layout plugin for jQuery + * The flip-side of CSS Floats + * http://masonry.desandro.com + * + * Licensed under the MIT license. + * Copyright 2012 David DeSandro + */ +(function(e,t,n){"use strict";var r=t.event,i;r.special.smartresize={setup:function(){t(this).bind("resize",r.special.smartresize.handler)},teardown:function(){t(this).unbind("resize",r.special.smartresize.handler)},handler:function(e,t){var n=this,s=arguments;e.type="smartresize",i&&clearTimeout(i),i=setTimeout(function(){r.dispatch.apply(n,s)},t==="execAsap"?0:100)}},t.fn.smartresize=function(e){return e?this.bind("smartresize",e):this.trigger("smartresize",["execAsap"])},t.Mason=function(e,n){this.element=t(n),this._create(e),this._init()},t.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},t.Mason.prototype={_filterFindBricks:function(e){var t=this.options.itemSelector;return t?e.filter(t).add(e.find(t)):e},_getBricks:function(e){var t=this._filterFindBricks(e).css({position:"absolute"}).addClass("masonry-brick");return t},_create:function(n){this.options=t.extend(!0,{},t.Mason.settings,n),this.styleQueue=[];var r=this.element[0].style;this.originalStyle={height:r.height||""};var i=this.options.containerStyle;for(var s in i)this.originalStyle[s]=r[s]||"";this.element.css(i),this.horizontalDirection=this.options.isRTL?"right":"left";var o=this.element.css("padding-"+this.horizontalDirection),u=this.element.css("padding-top");this.offset={x:o?parseInt(o,10):0,y:u?parseInt(u,10):0},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var a=this;setTimeout(function(){a.element.addClass("masonry")},0),this.options.isResizable&&t(e).bind("smartresize.masonry",function(){a.resize()}),this.reloadItems()},_init:function(e){this._getColumns(),this._reLayout(e)},option:function(e,n){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))},layout:function(e,t){for(var n=0,r=e.length;n