【发布时间】:2013-10-01 10:47:27
【问题描述】:
jQuery 在 Internet Explorer 10 中的页面加载时不会加载,必须按 (F5) / 或刷新页面才能加载。在 Chrome 和 Firefox 上,它可以完美加载;这只是导致问题的IE。似乎 jQzoom 导致了这个问题,因为唯一的脚本在页面加载时无法加载。
jQzoom 脚本:
$(document).ready(function() {
$('.jqzoom').jqzoom({
zoomType: 'standard',
lens:true,
preloadImages: false,
alwaysOn:false
});
});
我用来链接所有 jQueries 的函数:
'jQzoom2'就是上面提到的脚本:
function et_load_lucid_scripts(){
if ( !is_admin() ){
$template_dir = get_template_directory_uri();
wp_enqueue_script('sc1', $template_dir . '/js/scroll/jquery-1.3.2.js', array('jquery'), '1.0', true);
wp_enqueue_script('sc2', $template_dir . '/js/scroll/scroll-startstop.events.jquery.js', array('jquery'), '1.0', true);
wp_enqueue_script('jqzoom2', $template_dir . '/js/jq/jqzoom2.js', array('jquery'), '1.0', true);
wp_enqueue_script('navigation', $template_dir . '/js/navigation/jquery1.js', array('jquery'), '1.0', true);
wp_enqueue_script('navigation1', $template_dir . '/js/navigation/nav_touch.js', array('jquery'), '1.0', true);
wp_enqueue_script('jqzoom1', $template_dir . '/js/jq/jquery.jqzoom-core.js', array('jquery'), '1.0', true);
wp_enqueue_script('tracklist', $template_dir . '/js/test/jquery.dataTables.min.js', array('jquery'), '1.0', true);
wp_enqueue_script('new_tab', $template_dir . '/js/test/newtab.js', array('jquery'), '1.0', true);
wp_enqueue_script('html5', $template_dir . '/js/html5.js', array('jquery'), '1.0', true);
wp_enqueue_script('superfish', $template_dir . '/js/superfish.js', array('jquery'), '1.0', true);
wp_enqueue_script('flexslider', $template_dir . '/js/jquery.flexslider-min.js', array('jquery'), '1.0', true);
wp_enqueue_script('fitvids', $template_dir . '/js/jquery.fitvids.js', array('jquery'), '1.0', true);
wp_enqueue_script('custom_script', $template_dir . '/js/custom.js', array('jquery'), '1.0', true);
}
if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' );
$et_gf_enqueue_fonts = array();
$et_gf_heading_font = sanitize_text_field( et_get_option( 'heading_font', 'none' ) );
$et_gf_body_font = sanitize_text_field( et_get_option( 'body_font', 'none' ) );
if ( 'none' != $et_gf_heading_font ) $et_gf_enqueue_fonts[] = $et_gf_heading_font;
if ( 'none' != $et_gf_body_font ) $et_gf_enqueue_fonts[] = $et_gf_body_font;
if ( ! empty( $et_gf_enqueue_fonts ) ) et_gf_enqueue_fonts( $et_gf_enqueue_fonts );
}
add_action( 'wp_enqueue_scripts', 'et_load_lucid_scripts' );
【问题讨论】:
-
你能把一个 jsfiddle (jsfiddle.net) 放在一起来演示这个问题吗?这将使调试更容易。
-
嗨 Max,感谢您的回复.. 我尝试将脚本添加到 JS,但它们根本无法在 JS 中工作,可能是由于我正在使用多个脚本和链接。有没有办法强制 IE 仅重新加载/刷新特定页面?这将解决问题。谢谢:)
-
有什么帮助吗?一直试图让它工作好几个小时plzzz
-
您正在开发的页面是否可访问?也许我可以去那里看看。
-
嗨 Max,感谢您帮助我.. 是的,页面是 nsmmusic.com/products/digital-jukeboxes/icon-lite。问题是,在 IE 中,产品图像 (jQzoom) 在页面加载时不起作用,而当您点击 (F5) 时它才起作用。 Chrome / Firefox 完美运行它只是在 IE 中发生。再次感谢您的帮助:)
标签: jquery internet-explorer internet-explorer-10 pageload