admin管理员组文章数量:1328032
I have a jQuery UI Accordion implemented and as the page loads, you see content of the three headers and tabs for a few seconds, and then they turn into the accordion. I'm not sure which part is causing the delay, and hoping you can help.
In my functions.php
:
// Enqueue jQuery accordion
function product_accordion()
{
if ((is_product()) || (is_archive())){
wp_enqueue_style('jquery-ui', get_stylesheet_directory_uri() . '/css/jquery-ui.css', 10);
wp_register_script('jquery-core', get_stylesheet_directory_uri() . '.8.2.js', array('jquery'), '1.0', true);
wp_enqueue_script('jquery-core');
wp_register_script('jquery-ui', '.9.0/jquery-ui.js', array('jquery'), '1.0', true);
wp_enqueue_script('jquery-ui');
wp_register_script('accordion-snippet', get_stylesheet_directory_uri() . '/js/accordion-snippet.js', array('jquery'), '1.0', true);
wp_enqueue_script('accordion-snippet');
}
}
add_action('wp_enqueue_scripts', 'product_accordion');
The accordion-snippet.js
enqueued above:
jQuery('#accordion').accordion({
collapsible:true,
active:false,
autoHeight: false,
disabled:true,
heightStyle: "content"
});
jQuery('#accordion h3.ui-accordion-header').click(function(){
jQuery(this).next().slideToggle();
});
jQuery('.accordion-expand-all').click(function(){
jQuery('#accordion h3.ui-accordion-header').next().slideDown();
});
console.log("accordion-snippet.js loaded");
and you can see it here.
What is causing the delay in the Accordion being loaded? And / or any tips on troubleshooting this would be great too. Please let me know if I need to provide anything else.Thanks!
本文标签: jQuery UI Accordion loading very slow
版权声明:本文标题:jQuery UI Accordion loading very slow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742243485a2438980.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论