97久久国产亚洲精品超碰热,成人又色又爽的免费网站,色偷偷女人的天堂a,男女高潮喷水在线观看,国内精品一线二线三线区别在哪里

返回列表 發(fā)帖
查看: 61|回復(fù): 1

優(yōu)化dz x5導(dǎo)讀首頁(yè)各區(qū)域標(biāo)題展示為一行

TaC

114

主題

707

回帖

869

積分

自成一派

貢獻(xiàn)
5 點(diǎn)
金幣
2 個(gè)
今天,總算是微信能登錄跳轉(zhuǎn)到pc端網(wǎng)頁(yè)了,分享一下,這幾天的折騰,下面是上午折騰出來(lái)的。

使用 Trae 解決導(dǎo)讀首頁(yè)各內(nèi)容區(qū)域的展示問(wèn)題。實(shí)現(xiàn)標(biāo)題集中在一行顯示。默認(rèn)是展開(kāi),一個(gè)標(biāo)題區(qū)一個(gè)標(biāo)題區(qū)。
Trae 解決了:

- 1.所有標(biāo)題在一行水平顯示,支持滾動(dòng)。
- 2.鼠標(biāo)劃動(dòng)到標(biāo)題上時(shí),顯示對(duì)應(yīng)標(biāo)題下的內(nèi)容。
- 3.為標(biāo)題設(shè)置了寬度不超過(guò)21%的限制。
- 4.添加了指定的漸變背景色和圓角效果。
- 5.添加了白色1px邊框。
- 6.為"更多"鏈接設(shè)置了較小的字體和較淺的顏色。
  
下面分享原始代碼:
  • <!--{if $view == 'index'}-->
  •         <style type="text/css">
  •                 .guide-tabs-container {
  •                         display: flex;
  •                         overflow-x: auto;
  •                         white-space: nowrap;
  •                         margin-bottom: 15px;
  •                         padding: 5px;
  •                 }
  •                 .guide-tab {
  •                         flex: 0 0 auto;
  •                         width: 21%; /* 寬度不超過(guò)21% */
  •                         min-width: 150px; /* 最小寬度,確保內(nèi)容不會(huì)被壓縮得太小 */
  •                         padding: 10px 20px;
  •                         cursor: pointer;
  •                         position: relative;
  •                         background: linear-gradient(132deg,rgba(235,237,240,0.85) 9.65%,rgba(233,236,238,0.5) 58.96%,rgba(254,254,255,0.87) 86.15%);
  •                         border-radius: 5px;
  •                         border: 1px solid white;
  •                         margin-right: 10px;
  •                         transition: all 0.3s ease;
  •                         display: flex;
  •                         justify-content: space-between;
  •                         align-items: center;
  •                 }
  •                 .guide-tab:hover {
  •                         box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  •                 }
  •                 .guide-tab.active {
  •                         background: linear-gradient(132deg,rgba(220,225,230,0.85) 9.65%,rgba(215,220,225,0.5) 58.96%,rgba(240,245,250,0.87) 86.15%);
  •                         font-weight: bold;
  •                 }
  •                 .guide-content {
  •                         display: none;
  •                         padding: 15px 0;
  •                 }
  •                 .guide-content.active {
  •                         display: block;
  •                 }
  •                 /* 更多鏈接樣式 */
  •                 .guide-tab .more-link {
  •                         font-size: 12px; /* 字體小一點(diǎn) */
  •                         color: #888; /* 顏色比主標(biāo)題淺 */
  •                         text-decoration: none;
  •                 }
  •                 .guide-tab .more-link:hover {
  •                         color: #555;
  •                         text-decoration: underline;
  •                 }
  •                 /* 隱藏滾動(dòng)條但保留功能 */
  •                 .guide-tabs-container::-webkit-scrollbar {
  •                         display: none;
  •                 }
  •                 .guide-tabs-container {
  •                         -ms-overflow-style: none;
  •                         scrollbar-width: none;
  •                 }
  •         </style>
  •         <div class="guide-tabs-container">
  •                 <!--{loop $data $key $list}-->
  •                 <div class="guide-tab" data-target="tab-$key">
  •                         <span>
  •                                 <!--{if $key == 'hot'}-->{lang guide_hot}<!--{elseif $key == 'digest'}-->{lang guide_digest}<!--{elseif $key == 'newthread'}-->{lang guide_newthread}<!--{elseif $key == 'new'}-->{lang guide_new}<!--{elseif $key == 'my'}-->{lang guide_my}<!--{/if}-->
  •                         </span>
  •                         <a href="forum.php?mod=guide&view=$key" class="more-link">{lang more} ?</a>
  •                 </div>
  •                 <!--{/loop}-->
  •         </div>
  •         <!-- 內(nèi)容部分保持不變 -->
  •         <!--{loop $data $key $list}-->
  •         <div id="tab-$key" class="guide-content">
  •                 <div class="xl xl2 cl">
  •                         <!--{if $list['threadcount']}-->
  •                                 <!--{eval $i=0;}-->
  •                                 <!--{loop $list['threadlist'] $thread}-->
  •                                 <!--{eval $i++;$newtd=$i%2;}-->
  •                                 <li{if !$newtd} class="xl2_r"{/if}>
  •                                         <em>
  •                                                 <!--{if $key == 'hot'}--><span class="xi1">$thread[heats]{lang guide_attend}</span><!--{/if}-->
  •                                                 <!--{if $key == 'new'}-->$thread[lastpost]<!--{/if}-->
  •                                         </em>
  •                                         <i>· <a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight] target="_blank">$thread[subject]</a></i> <span class="xg1"><a href="forum.php?mod=forumdisplay&fid=$thread[fid]" target="_blank">$list['forumnames'][$thread[fid]]['name']</a></span>
  •                                 </li>
  •                                 <!--{/loop}-->
  •                         <!--{else}-->
  •                                 <p class="emp">{lang guide_nothreads}</p>
  •                         <!--{/if}-->
  •                 </div>
  •         </div>
  •         <!--{/loop}-->
  •         <script>
  •         jQuery(document).ready(function($) {
  •                 // 默認(rèn)顯示第一個(gè)標(biāo)簽的內(nèi)容
  •                 $('.guide-tab').first().addClass('active');
  •                 $('.guide-content').first().addClass('active');
  •                 // 鼠標(biāo)劃動(dòng)顯示對(duì)應(yīng)內(nèi)容
  •                 $('.guide-tab').hover(function() {
  •                         // 移除所有激活狀態(tài)
  •                         $('.guide-tab').removeClass('active');
  •                         $('.guide-content').removeClass('active');
  •                         // 添加當(dāng)前激活狀態(tài)
  •                         $(this).addClass('active');
  •                         var target = $(this).data('target');
  •                         $('#' + target).addClass('active');
  •                 });
  •         });
  •         </script>


在導(dǎo)讀首頁(yè)文件,找到:<!--{if $view == 'index'}-->,下面div標(biāo)簽,在這整個(gè)div標(biāo)簽里,<!--{else}-->上,替換上面內(nèi)容,即可。
因原始文件更改過(guò),查看默認(rèn)模板文件好象54-83行。
其它細(xì)節(jié),你還可以自己繼續(xù)優(yōu)化。

TaC

114

主題

707

回帖

869

積分

自成一派

貢獻(xiàn)
5 點(diǎn)
金幣
2 個(gè)
沙發(fā)
 樓主| 發(fā)表于 前天 13:16 | 只看Ta
本帖最后由 TaC 于 2025-10-14 13:18 編輯

下面是效果截圖:


總體感覺(jué),比一整個(gè)頁(yè)面都是標(biāo)題,來(lái)得美觀些。

本版積分規(guī)則

  • 關(guān)注公眾號(hào)
  • 有償服務(wù)微信
  • 有償服務(wù)QQ

手機(jī)版|小黑屋|Discuz! 官方交流社區(qū) ( 皖I(lǐng)CP備16010102號(hào) |皖公網(wǎng)安備34010302002376號(hào) )|網(wǎng)站地圖|star

GMT+8, 2025-10-16 04:08 , Processed in 0.041788 second(s), 9 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

關(guān)燈 在本版發(fā)帖
有償服務(wù)QQ
有償服務(wù)微信
返回頂部
快速回復(fù) 返回頂部 返回列表