如何消除“无样式内容的闪现”喜欢的行为
我有一个 jquery 手风琴滑块,它接受一系列定义列表并将它们变成交互式滑块小部件。
我正在寻求解决在脚本将幻灯片排列成正确格式之前幻灯片垂直列出的问题。它在较快的连接上不那么明显,但在较慢的连接上非常明显。
关于减轻这种影响的一般方法有什么想法吗? jQuery 是否提供快速解决方法?
这是我正在进行的工作...
css:
.my_slider {visibility:hidden;}
jquery:
jQuery(document).ready(function () {
jQuery('#slider-1').slider({
autoStart: true,
slideInterval: 5000,
slideNum:false,
});
jQuery('.my_slider').show();
});
我缺少什么?它不会将 div 的可见性切换为可见。
I've got a jquery accordian slider that takes a series of definition lists and turns them into an interactive slider widget.
I'm looking to solve the issue where the slides are listed vertically before the script arranges them into the proper format. Its not as apparent on faster connections, but really obvious on slower ones.
Any ideas on a general approach to mitigate this effect? Does jQuery offer a quick solution method?
Here's my work in progress...
css:
.my_slider {visibility:hidden;}
jquery:
jQuery(document).ready(function () {
jQuery('#slider-1').slider({
autoStart: true,
slideInterval: 5000,
slideNum:false,
});
jQuery('.my_slider').show();
});
What am I missing? Its not toggling the div's visibility to visible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以可接受的、有吸引力的方式设计定义列表。克隆基本标记,在内存中制作幻灯片标记,并在渲染时替换当前显示的列表。
Style the definition list in an acceptable, attractive manner. Clone the base markup, make the slideshow markup in memory, and when its rendered, replace the currently showing list.
一种方法是将整个折叠面板设置为
display: none;
,并在其位置放置一个相同大小的占位符div
。您可以随心所欲地使用占位符,或者将其保留为空白框;这都是个人喜好。设置一些 jQuery,以便一旦页面加载,临时 div 就会被删除并显示手风琴。One method would be to set the entire accordion to
display: none;
, and have in its place a placeholderdiv
of the same size. You can get as fancy as you like with the placeholder, or just leave it as a blank box; its all personal preference. Set up some jQuery so that as soon as the page loads the temporary div is removed and the accordion is shown.