javascript error in ngg.js with tooltip function – how to fix
-
line 30-34 is throwing a Javascript error which, in turn, is blocking the another (simple-modal login’s) plugins Javascript from running:
jQuery(document).tooltip({
content: function () {
return jQuery.parseHTML(this.getAttribute(“title”));
}
});It’s throwing the error because the tooltip function doesn’t exist because the plugin does not ensure the Javascript tooltip file with the tooltip function loads.
In order to fix this, I went in and made sure the jQuery tooltip widget file is included by going into the nggallery.php file in the main folder, finding where the ngg.js script is enqueued (line 506) and adding a dependency on ‘jquery-ui-tooltip’:
wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery'), '2.1');became
wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery', 'jquery-ui-tooltip'), '2.1');https://wordpress.org/plugins/nextcellent-gallery-nextgen-legacy/
The topic ‘javascript error in ngg.js with tooltip function – how to fix’ is closed to new replies.