[Wordpress] Ajouter des librairies JQuery dans un thème.
Ajouter les fichiers :
/wp-content/themes/montheme/js/jquery.jscrollpane.min.js
/wp-content/themes/montheme/js/jquery.mousewheel.js
Ouvrir :
/wp-content/themes/montheme/functions.php
Ajouter :
function myjqueryscripts_enqueue_scripts() { wp_enqueue_script( 'jquery' ); wp_register_script( 'jscrollpane', '/wp-content/themes/montheme/js/jquery.jscrollpane.min.js', 'jquery', '1.0.0' ); wp_enqueue_script( 'jscrollpane'); wp_register_script( 'jmousewheel', '/wp-content/themes/montheme/js/jquery.mousewheel.js', 'jquery', '1.0.0' ); wp_enqueue_script( 'jmousewheel' ); } add_action( 'wp_enqueue_scripts', 'myjqueryscripts_enqueue_scripts' );
Ouvrir :
/wp-content/themes/montheme/header.php
Chercher :
Ajouter avant :
Ouvrir :
/wp-content/themes/montheme/index.php
Chercher :
# Remplacer :
#
# $(document).ready(function()
#
# Par :
#
# jQuery(document).ready(function($)
#
$(document).ready(function() { jQuery(".inner").fadeIn("slow", function() { jQuery("#fiber").fadeIn("slow", function() { jQuery("#logo").fadeIn("slow", function() { jQuery("#listContact").fadeIn("slow", function() { jQuery("#listCreations").fadeIn("slow", function() { jQuery("#listAbout").fadeIn("slow", function() { jQuery(".line").fadeIn("slow", function() { }); }); }); }); }); }); }); });
Remplacer par :
jQuery(document).ready(function($) { jQuery(".inner").fadeIn("slow", function() { jQuery("#fiber").fadeIn("slow", function() { jQuery("#logo").fadeIn("slow", function() { jQuery("#listContact").fadeIn("slow", function() { jQuery("#listCreations").fadeIn("slow", function() { jQuery("#listAbout").fadeIn("slow", function() { jQuery(".line").fadeIn("slow", function() { }); }); }); }); }); }); }); });
Comments are closed, but trackbacks and pingbacks are open.