What to put inside jQuery(document).ready(function()

Been trying to get a javascript gallery to run in wordpress, but I’m not too sure what to put into the .ready(function) in order to run the gallery. The original page to the jQuery function is here: http://manos.malihu.gr/simple-jquery-fullscreen-image-gallery/2

I assume that I need to run some function that will run the entire javascript file, but I’m not quite sure what that function might be. Sorry for being so new to this, but thanks so much for any help!

function malihu_gallery() {
if (!is_admin()) {

    // Enqueue Malihu Gallery JavaScript
    wp_register_script('malihu-jquery-image-gallery', get_template_directory_uri(). '/js/malihu-jquery-image-gallery.js', array('jquery'), 1.0, true );
    wp_enqueue_script('malihu-jquery-image-gallery'); 

    // Enqueue Malihu Gallery Stylesheet
    wp_register_style( 'malihu-style', get_template_directory_uri() . '/CSS/malihu_gallery.css', 'all' );
    wp_enqueue_style('malihu-style' );

    function gallery_settings () { ?>
    <script type="text/javascript">
        jQuery(document).ready(function() {
            // What do I put in here?
        });
    </script><?php
    }
  }
}

add_action('init', 'malihu_gallery');

Related posts

Leave a Reply

1 comment

  1. I would guess, based on the limited view of the actual code, that this set of variables should be set/modified in that space:

    //config
    //set default images view mode
    $defaultViewMode="full"; //full, normal, original
    $tsMargin=30; //first and last thumbnail margin (for better cursor interaction) 
    $scrollEasing=600; //scroll easing amount (0 for no easing) 
    $scrollEasingType="easeOutCirc"; //scroll easing type 
    $thumbnailsContainerOpacity=0.8; //thumbnails area default opacity
    $thumbnailsContainerMouseOutOpacity=0; //thumbnails area opacity on mouse out
    $thumbnailsOpacity=0.6; //thumbnails default opacity
    $nextPrevBtnsInitState="show"; //next/previous image buttons initial state ("hide" or "show")
    $keyboardNavigation="on"; //enable/disable keyboard navigation ("on" or "off")
    

    Of course, this assumes these variables aren’t already set in your ‘/js/malihu-jquery-image-gallery.js’ file.