简体   繁体   English

在头中调用的Skel js并不总是加载到sharepoint 2013主页中

[英]Skel js called in head does not always load in sharepoint 2013 master page

I'm building a responsive website from the ground up for use as a SharePoint 2013 masterpage, using skel.js to control the grid and breakpoints. 我正在从头开始构建一个响应式网站,以用作SharePoint 2013母版,并使用skel.js控制网格和断点。 Once published, the js files (skel.min.js, skel-panels.min.js, jquery.min.js, html5shiv.js, and a simple config.js written by me to configure skel and skel-panels) do not reliably run every time a user hits the site, leaving the CSS frozen at whatever breakpoint the browser matched at the time. 一旦发布,js文件(skel.min.js,skel-panels.min.js,jquery.min.js,html5shiv.js和我编写的用于配置skel和skel-panels的简单config.js)就不会每次用户访问该网站时都能可靠地运行,从而使CSS冻结在浏览器当时匹配的任何断点处。 A refresh usually fixes the issue, but that's not an acceptable solution. 刷新通常可以解决该问题,但这不是可接受的解决方案。 So far this happens in IE, Chrome and FF (all versions that don't trigger html5shiv). 到目前为止,这种情况发生在IE,Chrome和FF(所有不会触发html5shiv的版本)中。

<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink1" name="~SiteCollection/Style Library/js/jquery.min.js" runat="server" Localizable="false"/>-->
<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink2" name="~SiteCollection/Style Library/js/skel.min.js" runat="server" Localizable="false"/>-->
<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink3" name="~SiteCollection/Style Library/js/skel-layers.min.js"  runat="server" Localizable="false"/>-->
<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink4" name="~SiteCollection/Style Library/js/jquery.dropotron.min.js"  runat="server" Localizable="false"/>-->
<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink5" name="~SiteCollection/Style Library/js/jquery.scrolly.min.js"  runat="server" Localizable="false"/>-->
<!--SPM:<SharePoint:ScriptLink language="javascript" ID="scriptLink10" name="~SiteCollection/Style Library/js/init.js" runat="server" Localizable="false"/>-->

Please help, I have been struggling to get right since last few days. 请帮助,自最近几天以来,我一直在努力正确。

It sounds like it is a timing issue. 听起来这是一个计时问题。 Your script is probably loading too early sometimes, so it doesn't work. 您的脚本有时可能加载得太早,因此无法正常工作。 I don't know much about skel (I found this post looking for more info about it), but you might be able to use a setTimeout to delay loading in your init.js file and see if that's what's wrong. 我对skel不太了解(我发现这篇文章是在寻找有关它的更多信息),但是您也许可以使用setTimeout延迟init.js文件的加载,然后看看这是怎么回事。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM