返回列表 发帖
查看: 37|回复: 9

[求助] 论坛设置宽版之后,公告跟下面栏目是正常切换,但是头部没变化,请问是什么情况?

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2 小时前 | 查看全部 |阅读模式
调成宽板之后会出现头部没有跟随的情况,但是其他栏目是正常没问题的
调成宽板之后会出现头部没有跟随的情况,但是其他栏目是正常没问题的
窄版是完全正常的,请问是什么原因导致?需要怎么设置
窄版是完全正常的,请问是什么原因导致?需要怎么设置
我知道答案 回答被采纳将会获得1 贡献 已有9人回答
回复

使用道具 举报

6

主题

1359

回帖

1845

积分

应用开发者

贡献
40 点
金币
183 个
QQ
发表于 2 小时前 | 查看全部
后台更新缓存在试试
回复

使用道具 举报

31

主题

6161

回帖

1万

积分

应用开发者

贡献
635 点
金币
1444 个
QQ
发表于 2 小时前 来自手机 | 查看全部
非默认模板的话,大概率是模板兼容问题
回复

使用道具 举报

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 1 小时前 | 查看全部
鸿茂传媒 发表于 2025-11-10 15:34
后台更新缓存在试试

已经更新过缓存 还是不行,基本静态HTML的代码 了一部分  是CSS冲突 还是代码问题?
回复

使用道具 举报

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 1 小时前 | 查看全部
湖中沉 发表于 2025-11-10 15:42
非默认模板的话,大概率是模板兼容问题;

- -我首页就时增加了 广告用了静态HTML
回复

使用道具 举报

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 1 小时前 | 查看全部
      
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: #f5f7fa;
            color: #333;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
        }
        
        .container {
            width: 100%;
            max-width: 1200px;
        }
        
        header {
            text-align: center;
            margin-bottom: 40px;
        }
        
        header h1 {
            font-size: 2.2rem;
            margin-bottom: 15px;
            color: #2c3e50;
        }
        
        header p {
            font-size: 1.1rem;
            max-width: 700px;
            margin: 0 auto;
            line-height: 1.6;
            color: #7f8c8d;
        }
        
        .notice-container {
            width: 100%;
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 40px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            background: white;
            border: 1px solid #e0e0e0;
        }
        
        .notice-board {
            height: 220px;
            overflow: hidden;
            position: relative;
        }
        
        .notice-list {
            list-style: none;
            position: relative;
            transition: transform 0.5s ease-in-out;
        }
        
        .notice-list li {
            height: 220px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 20px 25px;
            border-bottom: 1px solid #f0f0f0;
            transition: background 0.3s;
        }
        
        .notice-list li:hover {
            background: #f9f9f9;
        }
        
        .notice-title {
            font-size: 1.2rem;
            font-weight: bold;
            color: #2c3e50;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .notice-title i {
            color: #3498db;
        }
        
        .notice-content {
            color: #555;
            line-height: 1.6;
            margin-bottom: 12px;
        }
        
        .notice-date {
            color: #888;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .notice-indicators {
            display: flex;
            justify-content: center;
            padding: 15px;
            background: #f8f9fa;
            border-top: 1px solid #eee;
        }
        
        .indicator {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #ddd;
            margin: 0 5px;
            cursor: pointer;
            transition: all 0.3s;
        }
        
        .indicator.active {
            background: #3498db;
            transform: scale(1.2);
        }
        
        .new {
            background: #f0f8ff;
            border-left: 4px solid #3498db;
        }
        
        .demo-section {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 30px;
        }
        
        .demo-box {
            background: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
        }
        
        .demo-box h3 {
            color: #2c3e50;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .demo-box p {
            color: #555;
            line-height: 1.6;
        }
        
        footer {
            margin-top: 50px;
            text-align: center;
            color: #7f8c8d;
            padding: 20px;
            font-size: 0.9rem;
            width: 100%;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            header h1 {
                font-size: 1.8rem;
            }
            
            .notice-board {
                height: 200px;
            }
            
            .notice-list li {
                height: 200px;
                padding: 18px 20px;
            }
            
            .notice-title {
                font-size: 1.1rem;
            }
        }
        
        @media (max-width: 480px) {
            header h1 {
                font-size: 1.6rem;
            }
            
            .notice-board {
                height: 180px;
            }
            
            .notice-list li {
                height: 180px;
                padding: 15px;
            }
            
            .notice-title {
                font-size: 1rem;
            }
            
            .notice-content {
                font-size: 0.9rem;
            }
        }
    </style>

    <div class="container">
              
        <div class="notice-container">
            <div class="notice-board">
                <ul class="notice-list" id="noticeList">
                    <li >
                        <div class="notice-title"></i> 系统维护通知</div>
                        <div class="notice-content">为了提供更优质的服务,我们将在本周六凌晨2:00-6:00进行系统维护,期间服务将短暂不可用。</div>
                        <div class="notice-date"><i class="far fa-clock"></i> 2023-10-15</div>
                    </li>
                    <li>
                        <div class="notice-title"><i class="fas fa-star"></i> 新功能上线</div>
                        <div class="notice-content">我们很高兴地宣布,新版用户中心已上线,新增多项实用功能,欢迎体验并提供宝贵意见。</div>
                        <div class="notice-date"><i class="far fa-clock"></i> 2023-10-12</div>
                    </li>
                    <li>
                        <div class="notice-title"><i class="fas fa-flag"></i> 国庆节假期安排</div>
                        <div class="notice-content">根据国家法定节假日安排,我们的客服中心将于10月1日至10月7日放假,10月8日恢复正常服务。</div>
                        <div class="notice-date"><i class="far fa-clock"></i> 2023-09-28</div>
                    </li>
                    <li>
                        <div class="notice-title"><i class="fas fa-shield-alt"></i> 安全提醒</div>
                        <div class="notice-content">近期发现有不法分子冒充我司工作人员进行诈骗,请各位用户提高警惕,谨防上当受骗。</div>
                        <div class="notice-date"><i class="far fa-clock"></i> 2023-09-25</div>
                    </li>
                    <li>
                        <div class="notice-title"><i class="fas fa-sync-alt"></i> 产品更新日志</div>
                        <div class="notice-content">本次更新修复了已知的3个问题,优化了系统性能,提升了用户体验。详细更新内容请查看更新日志。</div>
                        <div class="notice-date"><i class="far fa-clock"></i> 2023-09-20</div>
                    </li>
                </ul>
            </div>
            
            <div class="notice-indicators" id="indicators">
                <!-- 指示器将由JS动态生成 -->
            </div>
        </div>
        
            </div>

  

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const noticeList = document.getElementById('noticeList');
            const indicatorsContainer = document.getElementById('indicators');
            
            const notices = noticeList.querySelectorAll('li');
            const noticeCount = notices.length;
            
            // 动态获取公告高度
            let noticeHeight = notices[0] ? notices[0].offsetHeight : 220;
            let currentIndex = 0;
            let autoScrollInterval;
            
            // 初始化指示器
            function initIndicators() {
                indicatorsContainer.innerHTML = '';
                for (let i = 0; i < noticeCount; i++) {
                    const indicator = document.createElement('div');
                    indicator.className = 'indicator';
                    if (i === currentIndex) {
                        indicator.classList.add('active');
                    }
                    indicator.addEventListener('click', () => {
                        goToNotice(i);
                    });
                    indicatorsContainer.appendChild(indicator);
                }
            }
            
            // 更新指示器状态
            function updateIndicators() {
                const indicators = document.querySelectorAll('.indicator');
                indicators.forEach((indicator, index) => {
                    if (index === currentIndex) {
                        indicator.classList.add('active');
                    } else {
                        indicator.classList.remove('active');
                    }
                });
            }
            
            // 滚动到指定公告
            function goToNotice(index) {
                currentIndex = index;
                const translateY = -currentIndex * noticeHeight;
                noticeList.style.transform = `translateY(${translateY}px)`;
                updateIndicators();
            }
            
            // 滚动到下一条公告
            function nextNotice() {
                currentIndex = (currentIndex + 1) % noticeCount;
                goToNotice(currentIndex);
            }
            
            // 开始自动滚动
            function startAutoScroll() {
                autoScrollInterval = setInterval(() => {
                    nextNotice();
                }, 4000);
            }
            
            // 鼠标悬停时暂停自动滚动
            noticeList.addEventListener('mouseenter', () => {
                clearInterval(autoScrollInterval);
            });
            
            // 鼠标离开时恢复自动滚动
            noticeList.addEventListener('mouseleave', () => {
                startAutoScroll();
            });
            
            // 窗口大小变化时重新计算高度
            window.addEventListener('resize', () => {
                const newHeight = notices[0] ? notices[0].offsetHeight : 220;
                if (newHeight !== noticeHeight) {
                    noticeHeight = newHeight;
                    goToNotice(currentIndex); // 重新定位当前公告
                }
            });
            
            // 初始化
            if (noticeCount > 0) {
                initIndicators();
                startAutoScroll();
            }
        });
    </script>
刚刚用了默认模板还是出现同样的问题 我添加的静态公告代码是这样子的
回复

使用道具 举报

31

主题

6161

回帖

1万

积分

应用开发者

贡献
635 点
金币
1444 个
QQ
发表于 1 小时前 | 查看全部
windy4038 发表于 2025-11-10 16:10
* {
            margin: 0;
            padding: 0;

你自己加的这个代码里就有限制头部最大宽度的样式定义,所以你自己这段代码造成的
回复

使用道具 举报

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 1 小时前 | 查看全部
湖中沉 发表于 2025-11-10 16:16
你自己加的这个代码里就有限制头部最大宽度的样式定义,所以你自己这段代码造成的 ...

- -尝试了 把这整个代码都删除了 然后更新缓存 还是不行 同样的老问题
回复

使用道具 举报

31

主题

6161

回帖

1万

积分

应用开发者

贡献
635 点
金币
1444 个
QQ
发表于 1 小时前 | 查看全部
windy4038 发表于 2025-11-10 16:35
- -尝试了 把这整个代码都删除了 然后更新缓存 还是不行 同样的老问题

你大概率还有其他代码限制呗,DZ标准产品是肯定没问题的,与其在这猜,你不如直接放出地址更实际
回复

使用道具 举报

2

主题

6

回帖

13

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 半小时前 | 查看全部
湖中沉 发表于 2025-11-10 16:37
你大概率还有其他代码限制呗,DZ标准产品是肯定没问题的,与其在这猜,你不如直接放出地址更实际 ...

- -因为是局域网没放出来 所以发不了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2025-11-10 17:46 , Processed in 0.053065 second(s), 9 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2025 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表