學習Discuz! X3.2記錄:對幻燈播放的進一步修改,包括css,程式碼
阿新 • • 發佈:2019-02-07
DIY論壇首頁模組屬性,縮圖寬度為600,高度為450,所以提交帖子圖片時候,把圖片設定為這麼大。
編輯前面的模組模板“DIY幻燈片BY_CBQ”程式碼為:
<div class="module cl slidebox"> <ul class="slideshow"> [loop] <li style="width: {picwidth}px; height: {picheight}px;"><a href="{url}"{target}><img src="{pic}" width="{picwidth}" height="{picheight}" /></a><span class="title">{title}</span></li> [/loop] </ul> </div> <script type="text/javascript"> runslideshow(); </script>
修改template\cbqtest\common\extend_common.css中/* 幻燈片 */部分:
/* 幻燈片 */ .slideblock { position: relative; border:#000000 solid thin; } .slideshow { clear: both; } .slideshow li { float:left; position: relative; overflow: hidden; } .slideshow span.title { position:absolute; top:330px; left:15px; width: 100%; height: 32px; line-height: 32px; font-size: 14px; text-indent: 10px; } .slideshow span.title, .slidebar li { background: rgba(0, 0, 0, 0.3); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr = #30000000, endColorstr = #30000000); color: {LIGHTLINK}; overflow: hidden; } .slidebar li { margin-top:360px; margin-left:10px; margin-right: 1px; width: 70px; height: 70px; line-height: 70px; text-align: center; font-size: 30px; cursor: pointer; } .slidebar li.on { background: rgba(255, 255, 255, 0.5); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr = #50FFFFFF, endColorstr = #50FFFFFF); color: #000; font-weight: 700; }
最後幻燈效果是: