简体   繁体   中英

JQuery UI Loading after other scripts in Wordpress

Im using a plug in which is using fancybox. However in the console it has the error

read property msie of undefined.

i think this has something to do with my NivoSlider which i have called in the wordpress functions file as below:-

<?php if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);

function my_jquery_enqueue() {

wp_deregister_script('jquery');

        wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', false, null, false);

        wp_enqueue_script('jquery');

wp_register_script( 'jquery-ui', get_template_directory_uri().'/js/jquery-ui.min.js', array('jquery'), false, null, false);

wp_enqueue_script( 'jquery-ui' );

wp_register_script( 'nivoslider', get_template_directory_uri().'/js/jquery.nivo.slider.pack.js', array('jquery'), null, false);

wp_enqueue_script( 'nivoslider' );

wp_register_script( 'nq', get_template_directory_uri().'/js/nqmedia.js', array('jquery'), null, false);

wp_enqueue_script( 'nq' );

}

?>

Website is www.nqmedia.co.uk

Can anyone advise as to why these two are clashing? Thanks

your website is using jQuery 1.9.1

in jQuery >= 1.9 jQuery.browser (or $.browser) was removed (see here: http://api.jquery.com/jQuery.browser/ )

the fancybox plugin is using $.browser.msie (where $.browser is undefined)

you need to use jQuery 1.8.3 if you want to use that fancybox plugin, or rewrite the plugin

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