Exclude Internet Explorer 7 when loading certain JS files
-
Hey guys,
A small problem. I have custom built a carousel script that works perfectly for IE 8 plus and on other browsers. I hate headaches, so I have decided to drop the support on IE 7.
How do I exclude the scripts loading for IE7? I am currently using Foundation themed tweaked by Drew and this is how the script loaded look like:
if ( ! function_exists( 'foundation_assets' ) ) : function foundation_assets() { if (!is_admin()) { // Load JavaScripts wp_enqueue_script( 'foundation', get_template_directory_uri() . '/js/foundation.min.js', null, '4.0', true ); wp_enqueue_script( 'modernizr', get_template_directory_uri().'/js/vendor/custom.modernizr.js', null, '2.1.0'); //if ( is_singular() ) wp_enqueue_script( "comment-reply" ); // Custom Scripts wp_enqueue_script( 'caraousel', get_template_directory_uri().'/js/caraousel.js', null, '1.0'); // ===> that is my baby right there wp_enqueue_script( 'custom', get_template_directory_uri().'/js/custom.js', '1.0', true); // Load Stylesheets wp_enqueue_style( 'normalize', get_template_directory_uri().'/css/normalize.css' ); wp_enqueue_style( 'foundation', get_template_directory_uri().'/css/foundation.min.css' ); wp_enqueue_style( 'app', get_stylesheet_uri(), array('foundation') ); } } add_action( 'wp_enqueue_scripts', 'foundation_assets' ); endif;
- The topic ‘Exclude Internet Explorer 7 when loading certain JS files’ is closed to new replies.