WordPress.org

Ready to get started?Download WordPress

Forums

Jquery UI (10 posts)

  1. astima
    Member
    Posted 2 years ago #

    I have almost resolved my jquery UI issue. The only problem I am having is that I was told to place this code in my header`<script>
    $(function(){
    $('#flip').jcoverflip();

    });
    </script>
    `
    When I look in firebug the error I get says: $ is not define

    I have tried changing $ to Jquery thinking that might help that it made no difference. Why is $ not defined?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

  3. astima
    Member
    Posted 2 years ago #

    okay, so I read through the file and I have done those things. I had a working on this for three days. And the only error message I have left to address is: $ is not define

    here is a page of a site where I am trying to use Jquery:http://www.stimadesigns.com/hunterdondistributors/our-portfolio/beer-2/

    if you cannot help me I would really appreciate if you point me to someone who can. I am really trying hard to make this work.

    thanks

  4. esmi
    Forum Moderator
    Posted 2 years ago #

  5. astima
    Member
    Posted 2 years ago #

    here is the function that only included in my functions.php

    function my_scripts_method() {
       // Change the uri to where jquery.jcoverflip.js is at.
       wp_register_script('jcover', ''.get_template_directory_uri().'/scripts/js/jquery.jcoverflip.js', 'jquery');
        wp_enqueue_script( 'jcover' );
    
       wp_enqueue_script('jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js', array('jquery'), '1.8.16');
       wp_enqueue_script('jcoverflip');
     }
      add_action('wp_enqueue_scripts', 'my_scripts_method');
    ?>

    prior to adding this function I was having issues these scripts were not loading. But now they do and the only error message I have left is about $. could it be an issue with the Jquery noconflict?

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    Yes.

  7. astima
    Member
    Posted 2 years ago #

    is that in a yes to it could be an issue with Jquery noconflict?

  8. fonglh
    Member
    Posted 2 years ago #

    Yes it is. Don't use the $. Use jQuery().

    It's explained on the wp_enqueue_script() page esmi linked to. Specifically the "jQuery noConflict wrappers" section.
    http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers

  9. astima
    Member
    Posted 2 years ago #

    No matter what I write this bit of code is giving me trouble. I have written it every way article suggests. what else could it be?

    <script>
      jQuery(document).ready(function(){
        jQuery('#flip').jcoverflip();
    
      });
    </script>
  10. fonglh
    Member
    Posted 2 years ago #

    Take the code out of your header.php file so you can enqueue it properly.

    The path to the js file is wrong.
    http://www.stimadesigns.com/hunterdondistributors/wp-content/themes/LondonLive/LondonLive/scripts/js/jquery.jcoverflip.js?ver=3.2.1 can't be found.

Topic Closed

This topic has been closed to new replies.

About this Topic