Community Forums › Forums › Archived Forums › General Discussion › SuperFish broken with JQuery 1.9+
- This topic has 4 replies, 4 voices, and was last updated 11 years, 10 months ago by
JM_Cook.
-
AuthorPosts
-
January 17, 2013 at 4:27 am #12587
jstuartj
MemberJust in case some of you run into the same problem, I just updated a plug-in that was en-queuing jQuery 1.9.0, which no-longer supports $.broswer therefore breaking Superfish.js. [It's looking for: $.brower.msie ]
The quick solution is to add the query-migrate-1.0.0.min.js plug-in which enables legacy browser sniffing. Hopefully superfish will be updated or replaced before WordPress updated its included version of jQuery.
jQuery Core 1.9 Upgrade Guide
jQuery.browser() removed
ThejQuery.browser()
method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.I added a js folder dropped the jQuery migrate plug into it and add the following to my function file.
/** Add JQuery Migrate to Genesis child theme */
add_action('wp_enqueue_scripts', 'bugfix_add_jquery_migrate');
function bugfix_add_jquery_migrate(){
if (!is_admin()) {
wp_register_script( 'jquery-migrate', get_stylesheet_directory_uri() . '/js/jquery-migrate-1.0.0.min.js', array('jquery'));
wp_enqueue_script( 'jquery-migrate');
}
}January 17, 2013 at 10:59 am #12646sheilab
ParticipantThanks so much for this.
I added the js folder with the query-migrate-1.0.0.min.js file at the same level as function.php in my theme and I am getting this parse error with the code I cut and pasted into my functions.php file. Please advise.
Parse error: syntax error, unexpected T_DNUMBER in /home/bergman2/luvnbitsnparts.com/wp-content/themes/venture/functions.php on line 32/** Add JQuery Migrate to Genesis child theme */
add_action(‘wp_enqueue_scripts’, ‘bugfix_add_jquery_migrate’);
function bugfix_add_jquery_migrate(){
if (!is_admin()) {
wp_register_script( ‘jquery-migrate’, get_stylesheet_directory_uri() . ‘/js/jquery-migrate-1.0.0.min.js’, array(‘jquery’));
wp_enqueue_script( ‘jquery-migrate’);
}
}January 17, 2013 at 6:30 pm #12759jstuartj
MemberLooks like something is changing single quotes to curly quote when I copy and pasted to the form... to my editor, you might check that, it happened in WeBuilder 2014 but note Notepad++. Let me try again in code tags maybe that will help.
Is there a way to edit posts? I would like to fix the above but I'm not finding away.
add_action('wp_enqueue_scripts', 'bugfix_add_jquery_migrate'); function bugfix_add_jquery_migrate() { if (!is_admin()) { wp_register_script( 'jquery-migrate', get_stylesheet_directory_uri() . '/js/jquery-migrate-1.0.0.min.js',array('jquery')); wp_enqueue_script( 'jquery-migrate'); } }
February 1, 2013 at 12:16 am #17002kylehufford
MemberMy site http://www.vanburenpubliclibrary.org should have the fancy drop downs and I have tried your fix with no luck. I just started on this site yesterday so it's not a situation where the drop downs ever worked. Thanks.
May 1, 2013 at 10:20 pm #38874JM_Cook
MemberAre there any plans to update the version of Superfish which is included with Genesis or does that create other problems?
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.