Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Trying to connect Smooth Div Scroll Jquery to my site but its not working?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #163053
    iizag
    Participant

    Hi I am trying to connect Smooth Div Scroll to my site: http://Izzy.me

    Smooth Div Scroll is this: http://smoothdivscroll.com/

    In my child functions php I have this :

    <?php
    
    function theme_javascript()
    {
        // wp_enqueue_script( 'name', path, array( 'dependencies' ), version, in-footer );
        wp_enqueue_script( 'myscript', get_template_directory_uri() . '/js/myscript.js', array('jquery'), '20140109', true );
       wp_enqueue_script( 'kinetic', get_template_directory_uri() . '/js/jquery.kinetic.min.js', array('jquery'), '20140109', true );   
       wp_enqueue_script( 'mousewheel', get_template_directory_uri() . '/js/jquery.mousewheel.min.js', array('jquery'), '20140109', true );  
       wp_enqueue_script( 'smoothdivscroll', get_template_directory_uri() . '/js/jquery.smoothdivscroll-1.3-min.js', array('jquery'), '20140109', true ); 
      wp_enqueue_script( 'jquery-ui-1.8.23.custom', get_template_directory_uri() . '/js/jquery-ui-1.8.23.custom.min.js', array('jquery'), '20140109', true ); 
          wp_enqueue_script( 'jquery-ui-1.10.3.custom', get_template_directory_uri() . '/js/jquery-ui-1.10.3.custom.min.js', array('jquery'), '20140109', true ); 
    }
    
    add_action( 'wp_enqueue_scripts', 'theme_javascript' );
    
    
    ?>
    

    In the front page of Izzy.Me I have 3 pictures of birds that I am using as an example to see if Smooth Div Scroll is connected.

    This is the CSS of those pictures:

    <div id="makeMeScrollable">
            <img src="//www.birds.com/wp-content/uploads/home/bird4.jpg" alt="Field" id="field" />
            <img src="//www.birds.com/wp-content/uploads/home/bird.jpg" alt="Gnome" id="gnome" />
            <img src="//3.bp.blogspot.com/-KFaKPd9ytxM/TxdKjRZulaI/AAAAAAAAD6A/w0kduvREq2w/s1600/bird-1-wallpaper-1024x768-853745.jpeg" alt="Pencils" id="pencils" />
        </div>
    

    –> I also placed the .min files from the smooth div scroll website in the Javascript file folder of my parent theme.

    —> What do I have written wrong I dont understand why this is not working, thank you for any help

    #163070
    Chromawoods
    Participant

    Looks like you’re trying to initialize it in myscript.js, right? But it looks weird.. There’s a script tag inside the script file… but it’s commented out? So nothing will happen.

    So maybe get rid of those script tags in myscript.js. :) Also, if you view the page with your console open, there are several JavaScript errors that you might want to take care of to make sure that it’s not conflicting with what you are trying to do.

    ..actually, the first error seems to come from the smoothdivscroll itself. Have you changed the plugin code in any way?

    #163326
    Chromawoods
    Participant

    so looking back now at the functions php i included does it look right ? ( thanks for your help )

    That was not what I meant. The PHP looked fine. I meant the content INSIDE myscript.js. There was a tag inside that js-file, which is weird. And then the actual smoothdivscroll initialization was commented out.

    So I’m still wondering how/where you are initializing the plugin and because that plugin gave an error, I also wonder if you have changed any code in jquery.smoothdivscroll-1.3-min.js.

    And as I said, if you open the console you will see several other errors that you might want to get rid of to ensure that they are not interfering with what you are trying to do.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.