FancyBox Question...

I am working with Fancybox…

http://www.fancyapps.com/fancybox/

I am a bit confused how to make it work properly for what I’d like.

I use this code in my

<script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox(); }); </script>.

i want to disable RIGHT CLICKING on images…
Needs this code…

$(".fancybox") .attr('rel', 'gallery') .fancybox({ beforeShow: function () { /* Disable right click */ $.fancybox.wrap.bind("contextmenu", function (e) { return false; }); } });

Here is the issue…

Code 1 allows usage of groups by changeing the rel= value…

<a class="fancybox" rel="group1" href="big_image_1.jpg"><img src="small_image_1.jpg" alt="" /></a> <a class="fancybox" rel="group1" href="big_image_2.jpg"><img src="small_image_2.jpg" alt="" /></a>

<a class="fancybox" rel="group2" href="big_image_1.jpg"><img src="small_image_1.jpg" alt="" /></a> <a class="fancybox" rel="group2" href="big_image_2.jpg"><img src="small_image_2.jpg" alt="" /></a>

if i use code 1 it seperates the groups… Group 1 and Group 2

If I use Code 2 it disable right clicking but groups are not seperated, (makes one group)

How can I combine the 2 Codes for this script to work?

the link is the script page…

http://www.eye-to-image.com/test.php is the page I am working on…
(using Code 2)

This code

$(".fancybox")
    .attr('rel', 'gallery')

Is changing all of your rel tags from “group1/group2” to “gallery”. I’m not sure what the purpose of doing that would be?

$(".fancybox").fancybox({
	beforeShow: function () {
		/* Disable right click */
		$.fancybox.wrap.bind("contextmenu", function (e) {
			return false; 
		});
	}
});
Sponsor our Newsletter | Privacy Policy | Terms of Service