Support » Fixing WordPress » Simple jQuery script not working in Template

  • I have a very basic jQuery lightbox effect script attached to a custom page in my WP template that’s not working. There’s no console errors, but the script doesn’t execute.

    I am enqueuing the script:

    wp_enqueue_script( 'lading-page', $this->dir .'/js/landing-page.js' );

    So that it gets called after jQuery does.

    Here’s the full script:

    jQuery(document).ready(function($){
    	$("a#show-panel").click(function(){
    		$("#lightbox, #lightbox-panel").fadeIn(300);
    	})
    	$("a#close-panel").click(function(){
    		$("#lightbox, #lightbox-panel").fadeOut(300);
    	})
    });

    When I view the source of the page, I can see the call to the Script:

    <script type='text/javascript' src='http://www.affinnova.com/wp-content/themes/affinova/js/landing-page.js?ver=3.6'></script>

    Any ideas why this might not be working?

Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Simple jQuery script not working in Template’ is closed to new replies.