Replies: 0
I’m attempting to disable an iFrame for mobile devices. I like the iframe for desktop, but it doesn’t work for mobile. Currently I’ve added the following to functions.php, however it doesn’t work.
add_action('wp_nav_menu','KillFancyBoxMobile',0);
function KillFancyBoxMobile() {
if (screen.width < 1000) {
remove_action('wp_enqueue_scripts', array('easyFancyBox', 'enqueue_styles'), 999);
remove_action('wp_head', array('easyFancyBox', 'main_script'), 999);
remove_action('wp_print_scripts', array('easyFancyBox', 'register_scripts'), 999);
remove_action('wp_footer', array('easyFancyBox', 'enqueue_footer_scripts'));
remove_action('wp_footer', array('easyFancyBox', 'on_ready'), 999);
}
}