Hi everyone,
I changed it so I could use fancybox instead of shutter. The things I changed are:
In js/ngg.js:
// add shutter-listeners again
//shutterReloaded.init('sh');
FancyBoxReload(); // So that it will load fancybox after updating
I also included fancyboxconf.js so that fancybox loads after start-up.
In nggalery.php – line 341 I added:
// activate Fancybox
if ( ($this->options['thumbEffect'] == "custom") ) {
wp_register_script('fancybox', NGGALLERY_URLPATH .'fancybox/jquery.fancybox-1.3.1.pack.js', false);
wp_enqueue_script( 'fancybox' );
wp_register_script('fancyboxConf', NGGALLERY_URLPATH .'fancybox/fancyboxConf.js', false);
wp_enqueue_script( 'fancyboxConf' );
}
You also have to change the if-test to add the ajax-script. You do this also in ngggalery.php a bit after the above snippet. There will allready be a script to load the ajax-navigation, you just have to alter the if-test so that it will call the ajax-js-file if you use the custom thumbEffect.
// Load AJAX navigation script, works only with shutter script as we need to add the listener
if ( $this->options['galAjaxNav'] ) {
if ( ($this->options['thumbEffect'] == "custom") ) {
wp_enqueue_script ( 'ngg_script', NGGALLERY_URLPATH . 'js/ngg.js', array('jquery'), '2.0');
wp_localize_script( 'ngg_script', 'ngg_ajax', array('path' => NGGALLERY_URLPATH,
'callback' => get_option ('siteurl') . '/' . 'index.php?callback=ngg-ajax',
'loading' => __('loading', 'nggallery'),
) );
}
}
In fancyboxConf.js is FancyBoxReload() declared.
fancyboxConf.js:
function FancyBoxReload() {
/* This is basic - uses default settings */
jQuery("a.fancybox").fancybox({
'titlePosition' : 'over',
'cyclic' : true,
'onComplete' : function() {
if(jQuery("span#fancybox-title-over").text() == " "){
jQuery("span#fancybox-title-over").parent().hide();
}
}
});
}
jQuery(document).ready(function() {
FancyBoxReload();
});
This way it will load fancybox on page-load and after receiving ajax-response.
I hope it can be of any help to you.