Tell me please! There is a function of a single gallery of the form:
$(function() { Gallery = (function() { // index of the current item var current = 0, // mode : carousel || fullview mode = 'carousel', // control if one image is being loaded anim = false, init = function() { // (not necessary) preloading the images here... $items.add('<img src="/public/images/ajax-loader.gif"/><img src="/public/images/black.png"/>').imagesLoaded( function() { // add options _addViewModes(); // add large image wrapper _addImageWrapper(); // show first image _showImage( $items.eq( current ) ); }); // initialize the carousel _initCarousel(); }; return { init : init}; })(); Gallery.init(); });
I need to change the value of the current variable on the onClick () event so that the value is changed before the gallery is initialized. Thank you in advance!
Upd1: Still very interested in how correctly Gallery is called in this case, and how can such pieces be accessed from outside this function and is it even possible?