0
<a class="fancybox-effects-d" href="source.jpg"><img src="source.jpg"></a>

i have typed scripts, links correctly and it displays the images well. but after it displays the image, i want to display box to be closed when i click outside of display box. interesting but the function that i want to do is available on fancy box effects a, b, c. like this. but the effect i want to use is d.

<a class="fancybox-effects-a" href="source.jpg"><img src="source.jpg"></a>

what to do?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
  • fancy box effects a, b, c are just examples, you don't have to use them. You can create your own custom script and bind it to your own class other than `fancybox-effects-X`. Regarding closing clicking inside/outside the box, check http://stackoverflow.com/a/8404587/1055987 for further reference. – JFK Sep 09 '13 at 20:57

1 Answers1

1

i found how to solve it...

you have to replace this code

            `$(".fancybox-effects-d").fancybox({
            padding: 0,

            openEffect : 'elastic',
            openSpeed  : 250,

            closeEffect : 'elastic',
            closeSpeed  : 500,

            closeClick : true,

            helpers : {
                overlay : {speedOut : 0}
            }
        });

the important thing is that overlay: in helpers was overlay: none. you have to delete none and and this code {speedOut : 0}

and another important thing is that which script you must do that?. in the demo folder, in index.html file, script codes starts 28. line and ends 211. you have to find

        // Remove padding, set opening and closing animations, close if clicked and disable overlay
        $(".fancybox-effects-d").fancybox({
            padding: 0,

            openEffect : 'elastic',
            openSpeed  : 250,

            closeEffect : 'elastic',
            closeSpeed  : 500,

            closeClick : true,

            helpers : {
                overlay : {speedOut : 0}
            }
        });`

you have to find this area. and change setting of overlay to {speedOut : 0 }.

after you apply this, you will see it works. you can also copy all script and create js file and connect it to your page. this makes it more simple.