nk-o / jarallax

Parallax scrolling for modern browsers

Home Page:https://jarallax.nkdev.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disable parallax in phones but keep the video

AhmedBadawy opened this issue · comments

Issue description:

I need to disable parallax on mobile phones but keep the video as background normal, I know there is an option to disable the video and keep the parallax.

jarallax(document.querySelectorAll('.jarallax'), {
    disableVideo: /iPad|iPhone|iPod|Android/
});

but I want the opposite of that!

When I use disableParallax it disables the video background too not the parallax only.

Version used:

1.12.0

Code to reproduce the issue (HTML blocks + JavaScript initialization)

<script src="https://unpkg.com/jarallax@1/dist/jarallax.min.js"></script>
<script src="https://unpkg.com/jarallax@1/dist/jarallax-video.min.js"></script>

<!-- Background YouTube Parallax -->
<div class="jarallax" data-jarallax-video="https://www.youtube.com/watch?v=ab0TSkLe-E0">
    Your content here...
</div>

<!-- Background Vimeo Parallax -->
<div class="jarallax" data-jarallax-video="https://vimeo.com/110138539">
    Your content here...
</div>
jarallax(document.querySelectorAll('.jarallax'), {
    disableParallax: /iPad|iPhone|iPod|Android/
});