Page 1 of 1

HowTo: FancyBox - Image Counter

Posted: Wed Oct 22, 2014 1:31 pm
by MVN
Hi, first of all ... thanxxx a lot for this great component!

I've added some code to the "index.php" of fancybox-popup (Path: ./plugins/content/admirorgallery/admirorgallery/popups/fancybox) to show an image counter. Now my part of "index.php" looks like this:

Code: Select all

<script type="text/javascript" charset="utf-8">
	AG_jQuery("a[rel=' . $this->popupEngine->rel . ']").fancybox({
		\'transitionIn\' : \'fade\', // Options: none, elastic, fade
		\'transitionOut\' : \'fade\',
		\'easingIn\' : \'easeOutBack\', // Option: swing
		\'easingOut\' : \'easeInBack\',
		\'overlayOpacity\' : \'1.0\', // Background-Transparency
		\'overlayColor\' : \'#000\', // Background-Color
		\'titleShow\' : \'true\',
		\'titlePosition\' : \'over\',	// Options: inside, outside, over || Also change <span id> at titleFormat!
		\'titleFormat\' : function(title, currentArray, currentIndex, currentOpts) {
			return \'<span id="fancybox-title-over">Image \' +  (currentIndex + 1) + \' of \' + currentArray.length + \'</span>\';	// code without image-title
			// return \'<span id="fancybox-title-over">Image \' +  (currentIndex + 1) + \' of \' + currentArray.length + \'&nbsp;-&nbsp;\' + title + \'</span>\';	// code with image-title
		}
	});
</script>
'Cause I'm an absolutely JavaScript-Noop, -Dummy (or whatever you want to say) ... can anyone please check this code, if there's a security risk?

BTW: I've removed the copyright-link from the gallery and added it to the credits of my site. Is this ok or allowed?

Update 30.10.2014:

After the code was checked by members of stackoverflow, I changed the subject to a "HowTo".

Re: HowTo: FancyBox - Image Counter

Posted: Fri Oct 31, 2014 2:13 am
by Vasiljevski
Nice work.

Thanks,