If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #20347


    Although I like the lightbox, I am not very keen with it on mobile device and would like to disable it when the user is on iPad / ios

    Would you be so nice that you have a bit of code for me to put in the avia.js?

    (I have tried the suggestion from this topic but it did not work: http://www.kriesi.at/support/topic/ (Purchase code hidden if logged out) -raygun-mobile-gallery-slider)




    Open up wp-content/themes/flashlight/js/avia.js and at the very bottom of the file insert the code from here: http://detectmobilebrowsers.com/download/jquery

    Then replace following line:



    var isMobile = jQuery.browser.mobile;
    if(jQuery.fn.avia_activate_lightbox && !isMobile)




    if(jQuery.fn.avia_activate_hover_effect && !isMobile)


    Hi Dude,

    Thanks for the answer although it does not seem to be working (I have refreshed/reset all browsers/devices and also tried with “false” instead of “true” just in case ….)

    The developer of the plugin I am using in this page told me to replace:

    autolinkElements: ‘a[rel^=”prettyPhoto”], a[rel^=”lightbox”], a[href$=jpg], a[href$=png], a[href$=gif], a[href$=jpeg], a[href$=”.mov”] , a[href$=”.swf”] , a[href*=”vimeo.com”] , a[href*=”youtube.com”] , a[href*=”screenr.com”]’


    autolinkElements: div:not(.justified-image-grid) a[rel^=”prettyPhoto”]

    but then the lightbox is not working at all on any pages of the website not using the justified-image-grid plugin… so that is not an option!

    Any ideas?





    I changed the code above a bit. Please try it again.

    Best regards,



    Hey Dude,

    Thanks but it does not quite work … it now directly opens the images in a page. Is there a way to disable the media link on images while on mobile?




    You should be able to remove the links from images with following code – add it to js/avia.js after the jquery document.ready code line at the very top of the file:

    var isMobile = jQuery.browser.mobile;
    if(isMobile) jQuery('.slideshow a').find('img').unwrap();

    I’m not sure if the unwrap() function works on iphones/mobile devices but it’s the only solution I’m aware of…


    Hey Dude

    Thanks but it still does not work. I ll cope with that and I ll soon be coming with other questions anyway…


    Hi alexthefunk,

    Sorry about that, hopefully we can help with any other questions or issues you have.



Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Disable lightbox on mobile device’ is closed to new replies.