• Hello,
    i started using this amazing software (wp) but i have one problem. I googled for many solutions for this problem but no luck. I have some simple scripts written in jquery but none of scripts work. How i can import jquery library to WP?

Viewing 2 replies - 1 through 2 (of 2 total)
  • We had this same question last week, a script to use the left and right keys to navigate pages.

    This was the solution, it will depend on what you are trying to do, and if there are no clashes with existing scripts.

    WordPress does not like the $(document).ready(function (), so you wrap it in a file, function like this, then call the file in functions.php

    (function($){ 'simple script goes here' })(jQuery);

    HTH

    David

    Thread Starter fl0w85

    (@fl0w85)

    Hello, thanks for reply. i have script like this

    <script type="text/javascript">
    $.noConflict();
        jQuery(function($) {
            $(document).ready(function(){
    			$('.demo6').jrumble({
    				speed: 50
    			});
    			$('.demo6').hover(function(){
    				$j(this).trigger('startRumble');
    			}, function(){
    				$(this).trigger('stopRumble');
    			});
    		});
        });
    </script>

    and it loads

    <script src="<?php bloginfo('template_directory');?>/js/jquery.jrumble.1.2.min.js" type="text/javascript"></script>

    and script work on html but no on WP

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘jQuery and WordPress’ is closed to new replies.