You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

移除scrollReveal左右滚动效果后Hostinger线上站点未生效求助

解决线上网站残留滚动展示效果的问题

问题背景

我在本地VS Code开发网站,原本带有左右滚动展示(left & right reveal)效果,为移除该效果,删除了script.js里最后两行设置左右滚动的代码:

原代码:

/*==================== scroll reveal ====================*/
ScrollReveal({
    // reset: true,
    distance: '120px',
    duration: 1600,
    delay: 150
});

ScrollReveal().reveal('.home-content, .main-text, .heading', { origin: 'top' });
ScrollReveal().reveal('.home-img, .services-container, .portfolio-box, .contact form', { origin: 'bottom' });
ScrollReveal().reveal('.home-content h1, .about-img', { origin: 'left' });
ScrollReveal().reveal('.home-content p, .about-content', { origin: 'right' });

修改后代码:

/*==================== scroll reveal ====================*/
ScrollReveal({
    // reset: true,
    distance: '120px',
    duration: 1600,
    delay: 150
});

ScrollReveal().reveal('.home-content, .main-text, .heading', { origin: 'top' });
ScrollReveal().reveal('.home-img, .services-container, .portfolio-box, .contact form', { origin: 'bottom' });

本地测试时左右滚动效果已正常移除,但将文件上传至Hostinger后,线上网站仍保留该效果。

解决步骤

  • 强制刷新浏览器缓存:浏览器会缓存旧的JS文件,按Ctrl+Shift+R(Windows/Linux)或Cmd+Shift+R(Mac)强制刷新,也可以右键点击刷新按钮,选择「清空缓存并硬刷新」。
  • 确认Hostinger上的文件已更新:登录Hostinger的文件管理器,找到你的script.js文件,打开查看内容,确保最后两行左右滚动的代码确实被删除。有时候上传可能因网络问题失败,导致旧文件未被覆盖。
  • 检查是否有其他脚本重复设置:查看网站的HTML文件,确认有没有其他<script>标签引入了包含ScrollReveal左右效果的脚本,比如其他JS文件或CDN链接可能重复添加了该效果。
  • 清除Hostinger服务器缓存:Hostinger可能启用了服务器级缓存(如CDN或主机自带缓存),登录Hostinger后台,找到缓存设置选项,清除所有服务器缓存。

内容的提问来源于stack exchange,提问作者Salah Eddine Souiss

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 10:42:34