简体   繁体   English

CSS最初不加载,不按刷新(F5或CTRL F5)加载,但按Link Click加载(有时)

[英]CSS Not Loading initially, Doesn't Load on Refresh (F5 or CTRL F5), but loads on Link Click (Occasionally)

Spent about a full day trying to figure this out so hoping someone can help me out! 花了整整一天的时间试图找出答案,希望有人可以帮助我! I'm new here so I apologize if this is a repeat question, (I did do my research and couldn't find anything in advance). 我是新来的,因此如果这是一个重复的问题,我深表歉意(我确实做了研究,但无法提前找到任何东西)。

My website I'm building for my Consulting company utilizes browser caching, but if the cache is cleared it doesn't load the CSS properly in my background / slider images. 我正在为我的咨询公司建立的网站使用浏览器缓存,但是如果清除了缓存,则无法在我的背景/滑块图像中正确加载CSS。 Instead of executing the CSS properly, the browser (Chrome, & Edge) Display them stacked on top of each other, while pushing the rest of the body down farther. 浏览器(Chrome和Edge)没有正确执行CSS,而是将它们堆叠在一起,同时将身体的其余部分向下推。

I do use server parsing for for certain nav scripts etc. For some reason the CSS won't load on a refresh, or hard refresh, but will load if the index.html link is clicked (either on logo, nav bar, etc). 我确实对某些导航脚本等使用服务器解析。出于某种原因,CSS不会在刷新或硬刷新中加载,但是如果单击index.html链接(在徽标,导航栏等上),则会加载CSS。 。

Nothing to hide so you can view the site at: http://www.okanaganmarketing.com 没有什么可隐藏的,因此您可以在以下位置查看该网站: http : //www.okanaganmarketing.com

Below if the slider code for the site as well: 如果该站点的滑块代码也是如此,则在下面:

    <div class="slider">
                <div class="fullwidthbanner-container">
                    <div class="fullwidthbanner">
                        <ul>
                            <li class="first-slide" data-transition="fade" data-slotamount="10" data-masterspeed="300">
                                <img src="assets/images/snap_dot.jpg" data-fullwidthcentering="on" alt="slide">
                                <div class="tp-caption first-line lft tp-resizeme start" data-x="center" data-hoffset="0" data-y="250" data-speed="1000" data-start="200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">Grow Your Business</div>
                                <div class="tp-caption second-line lfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="340" data-speed="1000" data-start="800" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">We Specialize In Marketing Strategy & Implementation</div>
                                <div class="tp-caption slider-btn sfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="510" data-speed="1000" data-start="2200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0"><a href="#" class="btn btn-slider">We'll Show You How</a></div>
                            </li>
                            <li class="first-slide" data-transition="fade" data-slotamount="10" data-masterspeed="300">
                                <img src="assets/images/millenials_2_dot_grey.jpg" data-fullwidthcentering="on" alt="slide">
                                <div class="tp-caption first-line lft tp-resizeme start" data-x="center" data-hoffset="0" data-y="250" data-speed="1000" data-start="200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">Engage Your Customers</div>
                                <div class="tp-caption second-line lfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="340" data-speed="1000" data-start="800" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">Social Media Marketing & Account Managment</div>
                                <div class="tp-caption slider-btn sfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="510" data-speed="1000" data-start="2200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0"><a href="#" class=" second-btn btn btn-slider">We'll Take Care Of It For You</a></div>
                            </li>
                            <li class="first-slide" data-transition="fade" data-slotamount="10" data-masterspeed="300">
                                <img src="assets/images/sunset.jpg" data-fullwidthcentering="on" alt="slide">
                                <div class="tp-caption first-line lft tp-resizeme start" data-x="center" data-hoffset="0" data-y="250" data-speed="1000" data-start="200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">Reach The Right Customers</div>
                                <div class="tp-caption second-line lfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="340" data-speed="1000" data-start="800" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0">Marketing Communications & Media Exposure For Your Business</div>
                                <div class="tp-caption slider-btn sfb tp-resizeme start" data-x="center" data-hoffset="0" data-y="510" data-speed="1000" data-start="2200" data-easing="Power4.easeOut" data-splitin="none" data-splitout="none" data-elementdelay="0" data-endelementdelay="0"><a href="#" class="btn btn-slider">We'll Help You Reach Your Goals</a></div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>

If someone can help me that would be greatly appreciated as I am running out of ideas! 如果有人可以帮助我,那我将不胜感激! Thanks in advance for your help!! 在此先感谢您的帮助!!

For anyone who runs into the same problem hopefully this will be of some help to you. 希望对遇到相同问题的任何人有帮助。 I managed to figure it out myself, and not entirely sure which part ended up fixing the problem but nonetheless it is now fixed. 我设法自己弄清楚了这一点,虽然不能完全确定哪一部分最终可以解决问题,但是现在已经解决了。

I was using server parsing for .shtml docs, to include my scripts in my footer (so I didn't have to edit them all over my website) and noticed when I looked at my javascript and JQuery scripts individually I was running them with the ASYNC attribute, which for some reason, when in a parsed file seemed to be causing the problem. 我使用服务器解析.shtml文档,将我的脚本包含在页脚中(因此,我不必在网站上进行全部编辑),并且注意到当我分别查看javascript和JQuery脚本时,我正在使用ASYNC属性,由于某种原因,在解析的文件中时,似乎是引起问题的原因。 As soon as I removed the ASYNC attribute from the slider related JQuery Files, it ran smooth as a button! 一旦我从与滑块相关的JQuery文件中删除了ASYNC属性,它就可以像按钮一样运行!

If anyone runs into this problem hopefully this will be of some assistance! 如果有人遇到这个问题,希望会对您有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 按下CTRL + F5后应用CSS,但是在下一个动作上没有,直到我再次按CTRL + F5 - CSS applies after pressing CTRL + F5, but on next action it doesn't, until I press CTRL + F5 again Ctrl + F5导致页面跳转,但F5不会 - Ctrl + F5 causes page to jump around but F5 does not 硬重载加载新的 css 但 f5 加载旧版本(即使在硬重载之后) - hard reload loads new css but f5 load the older version (even after the hard reload) 刷新 (F5) 后按钮的“禁用”属性在 FireFox 中不起作用 - The button's "disabled" attribute doesn't work in FireFox after the refresh (F5) Javascript函数仅在刷新后运行(f5) - Javascript Functions Only Run After Refresh (f5) 如何使用刷新(F5)更新api背景图片? - How to use refresh (F5) to update api background image? 如何在不按 CTRL + F5 的情况下使 Elementor 更改可见? - How do you make Elementor changes visible without pressing CTRL + F5? 文档的总高度函数的返回值在浏览器刷新时发生变化 (F5) - Document's total height function's return value changes on browser refresh (F5) 除非F5刷新页面,否则部署在heroku上的网页显示空白背景 - webpage deployed on heroku shows blank background unless F5 refresh the page 使用浏览器刷新页面(F5)重新加载页面时,Odoo状态栏出现故障 - Odoo status bar glitches when I reload the page using browser refresh page (F5)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM