Disable shadowbox on mobile browsers

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Disable shadowbox on mobile browsers

mix998
hi there,
i found a couple of topics talking about this subject, but since i'm not very familiar with javascript, i can't figure out how to solve the issue i'm having. Here's the website http://abitarevarese.it/

I'm trying to disable shadowbox on mobile but keeping it working on desktop version of the website.

this is the topic i found, with a plausible solution  http://shadowbox.1309102.n2.nabble.com/Disable-on-mobile-td7073303.html

as suggested on the topic, i went on http://detectmobilebrowsers.com/ and downloaded the js file, put it into my js folder and linked it in my webpage

this is the shadowbox function i have on my website (i need some particular features for the website and i need them to work n desktop site)

<script type="text/javascript"> Shadowbox.init({ language: 'en', players: ['html', 'iframe'], modal: true, onOpen: onShOpen, onClose: onShClose }); function onShOpen() { document.body.style.overflow = "hidden"; return true; } function onShClose() { document.body.style.overflow = "visible"; return true; } </script>


even with the topic under my eyes, i can't figure out how to do it..can anybody help?



bonus question: as you can see the website is a scrolling one page website, is there any way to make it return to an anchow as i close the shadowbox on desktop version?

many, many, many many thanks