Single Image using Lightbox Overlay
Hi All,
I have a custom layout that I developed & in this custom layout the user will use the image control to place an image in the page. I'll be using CSS to slim down the width & height of the uploaded image to match design specs, but what I would like to do is apply the Sitefinity Lightbox Overlay to a link tag that is wrapped around this image. I know I could have the user use the image gallery control & filter the image based on tags, but it would really be simpler for them to use the image control.
I've seen that the images in the image gallery control that use the lightbox overlay have a class of sfLightBox & a rel of mainImageGallery. When I try & apply these settings to my link that is wrapped around my image, it simply opens the image in the browser.
Is there any settings I can apply using javascript to have the image open using the Sitefinity overlay method?
Thanks,
Brian
Hi Brian,
Sorry for the delay on this. We are using fancybox. You can do something like this:
jQuery(
'#'
+
"id_of_your_outer_html_element"
+
" a.sfLightBox"
).fancybox();
Hi,
We are having the same issue. Could please tell where should we add this.
jQuery(
'#'
+
"id_of_your_outer_html_element"
+
" a.sfLightBox"
).fancybox();
Hi Karnan,
You can drop a JavaScript widget on the page and set it to render before the closing </body> tag. Then in this widget you could write some jQuery code like this:
jQuery(document).ready(
function
()
// Execute the code here
);