-
AuthorPosts
-
February 12, 2020 at 5:43 pm #1183951
Hi
I need to customize the behavior of the default Enfold lightbox as follows:
- a tags that have an href attribute ending with .svg should be opened automatically in a lightbox (same as .jpg or .gif). Currently, SVGs only open in the lightbox when adding rel=”lightbox”
- If a page has multiple images that are opened in a lightbox, they should not automatically be combined into a group
What is the best way to do this?
Thanks
February 13, 2020 at 8:35 pm #1184290Hey Jeannette,
Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)
Best regards,
VictoriaFebruary 14, 2020 at 4:12 pm #1184543Hi Victoria
Many thanks for your answer.
In the file avia-snippet-lightbox.js I see the definition of the functionavia_activate_lightbox(variables)
. With the parametervariables
I think there is a possibility to adjust the default values of the lightbox. But I’m not sure how to adjust the function call by the template so that I can set the parametervariables
with my own values.Thanks
February 17, 2020 at 5:08 pm #1185295Hi blende64,
Well, you can consult the documentation here:
https://dimsemenov.com/plugins/magnific-popup/documentation.htmlIf you need further assistance please let us know.
Best regards,
VictoriaFebruary 18, 2020 at 11:33 am #1185602Hi
I was able to add SVG support using Monkey Patching. In my JS file with the code for my child-theme I overwrite the elements to which the lightbox is applied with the following code:
let avia_activate_lightbox_orig = $.fn.avia_activate_lightbox; $.fn.avia_activate_lightbox = function() { avia_activate_lightbox_orig.apply(this, [{ autolinkElements: 'a.lightbox, a[rel^="prettyPhoto"], a[rel^="lightbox"], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=svg], a[href*=".jpg?"], a[href*=".png?"], a[href*=".gif?"], a[href*=".jpeg?"], a[href*=".svg?"], a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]', }]); };
Maybe it’ll help somebody else.
February 18, 2020 at 7:43 pm #1185792Hi blende64,
Glad you got it working for you and thank you for sharing! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.