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

    Hi,

    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/angular-replace-prettyphoto-lightbox-with-raygun-mobile-gallery-slider)

    Regards

    Alex

    #107287

    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:

    if(jQuery.fn.avia_activate_lightbox)

    with:

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

    and:

    if(jQuery.fn.avia_activate_hover_effect)

    with:

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

    #107288

    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"]‘

    by

    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?

    Thanks

    Alex

    #107289

    Hey!

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

    Best regards,

    Peter

    #107290

    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?

    Regards

    Alex

    #107291

    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…

    #107292

    Hey Dude

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

    #107293

    Hi alexthefunk,

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

    Regards,

    Devin

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

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