Reputation: 15
I would like to disable following script when the website is opened in mobile device, because i don't want unnecesary animations:
<script src="js/eskju.jquery.scrollflow.js"></script>
In HTML this script works with these classes:
<div class="scrollflow -slide-right -opacity">
//some code...
</div>
I'm begginer, and I have little knowledge about JavaScript. Thanks in advance.
Upvotes: 0
Views: 3310
Reputation: 526
Add an ID to this script:
<script src="js/eskju.jquery.scrollflow.js" id="scScrollFlow"></script>
Add this javascript code at the bottom of your BODY:
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)) {
$('#scScrollFlow').remove();
}
Update: I have tested it for you. This following solution will work fine:
First, open your file eskju.jquery.scrollflow.js, find and remove this code:
$( document ).ready( function()
{
new ScrollFlow();
});
Add this javascript code to your site:
<script>
$( document ).ready( function()
{
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent) == false) {
new ScrollFlow();
}
});
</script>
Upvotes: 1