GetSimple Support Forum

Full Version: Simple Question / FancyBox
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Guys,

normally I'm using i18n-Galleries on my site but on some pages I simply want single pictures to expand using fancybox. Somehow I don't get it to work. I just add a picture, add a link to a bigger version and add rel="fancybox" to the href, right?

In my case it simply opens the picture with no fancybox being showed. Do you know what I'm doing wrong? Blush
are you using the fancybox plugin ?
(2015-09-07, 20:43:56)stwneu Wrote: [ -> ]Hey Guys,

normally I'm using i18n-Galleries on my site but on some pages I simply want single pictures to expand using fancybox. Somehow I don't get it to work. I just add a picture, add a link to a bigger version and add rel="fancybox" to the href, right?
/
In my case it simply opens the picture with no fancybox being showed. Do you know what I'm doing wrong?  Blush

Assuming you use Fancybox plugin, you should use id = fancybox

I think you use rel only to create a relationship between images and so creating a gallery in Fancybox.


See also updated code in this topic:

http://get-simple.info/forums/showthread.php?tid=7439 (which uses class = fancybox)


You can also use i18N Gallery to show a single image, although I don't know how (appart from using a tag). You should ask in the topic of i18N Gallery.
I tried using the fancybox-plugin. When I do so I have to set rel to "fancybox" and it works. But then, when I try to close my navigationbar, it re-opens itself... Huh Don't know why it behaves like this, but so this is not an option.

I thought you don't have to install any plugin to use fancybox?

Creating a i18n-gallery with one picture could be an option, but that means having dozens of galleries, which is not the best solution.. Undecided
(2015-09-09, 18:30:28)stwneu Wrote: [ -> ]Creating a i18n-gallery with one picture could be an option, but that means having dozens of galleries, which is not the best solution.. Undecided

No, you can just use one gallery and give every image a different tag.

Image 1:
Code:
(% gallery name=lonely-images type=fancybox tags=lion %)

Image 2:
Code:
(% gallery name=lonely-images type=fancybox tags=shark %)

Quote:I thought you don't have to install any plugin to use fancybox?

I think you can place it in your theme, but I never tried that. It's just not included in the cms as a frontend option.

Quote:I tried using the fancybox-plugin. When I do so I have to set rel to "fancybox" and it works. But then, when I try to close my navigationbar, it re-opens itself...  Huh Don't know why it behaves like this, but so this is not an option.

I don't know what you mean with closing your navigation bar, but you should use id="fb" instead of rel="fancybox" rel="fancybox" creates a gallery of one image, so if you place a second image and do the same, you get a gallery of 2 images (gallery = fancybox).

Btw. this is all described in the plugin description: http://get-simple.info/extend/plugin/fan...lugin/404/
Fancybox pligin only includes fancybox if you want to initialize it you have to do that on your own in js.
Thank you all for your help. I don't know why my navigation is behaving so strangely when I activate the fancybox-plugin. But for now, the i18n-gallery with filtering by tag seems the best option for me.
Thanks! Smile
I finally found the solution to the problem with my navbar!
Once I deleted the line "queue_script('jquery', GSFRONT);" in the fancyboxconfig.js it worked smoothly. So the problem seems to be two instances of jquerry running if I am right?
Now almost everything is fine just one litte question: The navbar is displayed always on top and thus cuts off the upper fancy-box frame (I don't know its z-index value.) Do you know what I have to change so that the image being displayed in the fancybox is always on top? Big Grin
... and can you somehow add a caption to the picture in the fancybox?
(2015-09-11, 19:28:45)stwneu Wrote: [ -> ]Now almost everything is fine just one litte question: The navbar is displayed always on top and thus cuts off the upper fancy-box frame (I don't know its z-index value.) Do you know what I have to change so that the image being displayed in the fancybox is always on top?  Big Grin

I think you can figure out it's z-index via the devoloper console (usually F12). 

stwneu Wrote:... and can you somehow add a caption to the picture in the fancybox?

You have to add a title=" ... " to the image url. See http://fancyapps.com/fancybox/#docs for examples.