jQuery 插件的测试页面在 Chrome 中查看时显示无样式代码的闪烁 - 为什么?

发布于 2024-10-08 03:02:56 字数 542 浏览 0 评论 0原文

我正在尝试使用 jQuery 实现一个基本的下滑面板,基于以下插件:

http://samuelgarneau.com /lab/slidebox/

我遇到的问题是,当我在 Chrome 中查看时,左上角似乎有一闪而过的无样式内容(来自面板)。这是链接:

http://www.asolidsite.com/clients/glennstar/ custom/index.html

这在插件演示中不会发生 - 所以我一定是搞砸了一些东西。但我尝试过玩各种各样的东西,但没有运气。想知道是否有人对 jQuery 有一定的了解。

我想知道 jQuery bg resizer 是否可能会干扰事物(并导致它在加载时滞后如此之多......)。

感谢您的帮助!

I am trying to implement a basic slide down panel using jQuery, based on the following plugin:

http://samuelgarneau.com/lab/slidebox/

The problem I'm having is that there seems to be a flash of unstyled content (from the panel) in the top left corner when I look at it in Chrome. Here is the link:

http://www.asolidsite.com/clients/glennstar/custom/index.html

This doesn't happen in the plugin demo - so I must've mucked something up. But I've tried playing with all kinds of things, to no luck. Wondering if there might be someone with some jQuery insight.

I wonder if the jQuery bg resizer might be interfering with things (and causing it to lag so much on load...).

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鯉魚旗 2024-10-15 03:02:56

您是否尝试过更改源代码以将全屏背景 javascript 和滑块 javascript 放在一起?因为现在你有一个,然后是另一个,然后依次是每个的 jquery 操作。最好先有全屏后台脚本,然后是 jquery 操作,然后是滑块脚本,然后是 jquery 操作。我还会在底部添加 cufon 脚本,因为即使它没有立即加载,它对功能的影响也最小。

另外,如果这对您不起作用,请更改全屏背景和滑块脚本,以便滑块在全屏背景之前加载。由于它是一个相当大的文件,这可能会导致抖动。

示例:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>    
<script type="text/javascript" src="js/jquery.fullscreenr.js"></script>
<script type="text/javascript">  
          <!--
          var FullscreenrOptions = {  width: 1400, height: 895, bgID: '#bgimg' };
          jQuery.fn.fullscreenr(FullscreenrOptions);
          //-->
</script> 
<script type="text/javascript" src="js/slidebox.js"></script>     
<script type="text/javascript">  
                $(document).ready(function(){
                    $("#slider").slideBox({width: "100%", height: "200px", position: "top"});
                });
</script>
<script type="text/javascript" src="js/cufon-yui.js"></script>

顺便说一下(也是题外话),我认为这个设计很漂亮。如果我没猜错的话,我以前住的地方离艾伯塔省梅迪辛哈特这个地区很近。

Have you tried changing the source code around to have the fullscreen background javascript together and the slider javascript together? Because right now you have one, then the other and then the jquery action for each in turn. It might be better to have the fullscreen background script, then the jquery action, then the slider script followed by the jquery action. I'd also add the cufon script at the bottom because even if it doesn't load immediately, it has the least impact on functionality.

Also, if that doesn't work for you, change the fullscreen background and the slider scripts around, so the slider loads before the fullscreen background. As it is quite a large file, this could be causing the jitter.

Example:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>    
<script type="text/javascript" src="js/jquery.fullscreenr.js"></script>
<script type="text/javascript">  
          <!--
          var FullscreenrOptions = {  width: 1400, height: 895, bgID: '#bgimg' };
          jQuery.fn.fullscreenr(FullscreenrOptions);
          //-->
</script> 
<script type="text/javascript" src="js/slidebox.js"></script>     
<script type="text/javascript">  
                $(document).ready(function(){
                    $("#slider").slideBox({width: "100%", height: "200px", position: "top"});
                });
</script>
<script type="text/javascript" src="js/cufon-yui.js"></script>

By the way (and off-topic), I think the design is beautiful. If I'm right, I used to live real close to this area, Medicine Hat, AB.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文