Im using a custom js which ive coded in a fiddle, and im wanting to integrate it into my wordpress theme: I have used the register and enqueue scripts as below, and they appear to be loading correctly, however it is the custom.js that appears to be erroring.
Please can someone inform me if i have missed a tag or something as i am stuck. Below is my code:-
/My Functions File/
<?php
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") ."://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
wp_register_script( 'jquery-ui', get_template_directory_uri().'/js/jquery-ui.min.js', array('jquery'), true );
wp_enqueue_script( 'jquery-ui' );
wp_register_script( 'custom', get_template_directory_uri().'/js/custom.js', array('jquery-ui'), true );
wp_enqueue_script( 'custom' );
}
?>
/My custom JS file*/
$(document).ready(function() {
$("h1, h2").on('click', function (e) {
e.preventDefault();
$(this).effect( "bounce", { times : 2, direction : "down", distance : "3" }, 200)
});
Thankyou
Kirsty
You forgot to close your document.ready