简体   繁体   中英

jQuery does not load on page load on Internet Explorer 10; only loads on page refresh (F5)

jQuery does not load on page load in Internet Explorer 10 and have to press (F5) / or refresh the page for it to load. On Chrome and Firefox it loads perfectly; it's just IE that's causing the issue. It seems to be like jQzoom is causing the issue because that the only script is failing to load on page load.

jQzoom Script:

$(document).ready(function() {
$('.jqzoom').jqzoom({
        zoomType: 'standard',
        lens:true,
        preloadImages: false,
        alwaysOn:false
    });
});

Function that I am using to link all the jQueries:

'jQzoom2' is the script mentioned above:

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' );

Add <meta http-equiv="X-UA-Compatible" content="IE=10"> into the head of your page.

This may also fix other js issues with content sliders and images. Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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