JQuery plugin on WordPress child theme

Home Forums General Discussion JQuery plugin on WordPress child theme

This topic contains 1 reply, has 1 voice, and was last updated by  lassewagner 4 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #42417

    lassewagner
    Member

    Hi!
    I was hoping you wonderful people could help me with a jQuery plugin, found on this page:
    http://tympanus.net/codrops/2012/11/29/simple-effects-for-drop-down-lists/
    I’m using wordpress with a child theme. In my child themes functions.php i’ve tried the following:

    add_action( 'wp_enqueue_scripts', 'load_javascript_files' );

    function load_javascript_files() {

    wp_register_script( 'jquery.dropdown', get_stylesheet_directory_uri() . '/js/jquery.dropdown.js', array('jquery'), true );
    wp_register_script( 'modernizr.custom.63321', get_stylesheet_directory_uri() . '/js/modernizr.custom.63321.js', array('jquery.dropdown'), false );

    wp_enqueue_script( 'jquery.dropdown' );
    wp_enqueue_script('modernizr.custom.63321');


    Then added this in my header, just before the wp_head():

    script type="text/javascript">
    $(document).ready(function() {
    $( '#cd-dropdown' ).dropdown( {
    gutter : 5
    } );
    /script>

    Then i called the function in my footer, where i want the dropdown:

    select id="cd-dropdown" class="cd-select">
    option value="-1" selected>Choose an animal
    option value="1" class="icon-monkey">Monkey
    </select

    #42418

    lassewagner
    Member

    Sorry for the missing tags. If included, i couldn’t write all my code.

    Thanks!!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.