0
$('a[href^="#"]').on('click',function (e) {
                    e.preventDefault();

                    var target = this.hash;
                    $target = $(target);
                    $target.addClass('active');
                    $('html, body').stop().animate({
                        'scrollTop': $target.offset().top
                        }, 1000, 'swing');
});

HTML Code

                        <div style="position: fixed;font-size:15px">

                                <a href="#header-wrapper">Home</a><br>
                                <a href="#about">About</a>  <br>
                                <a href="#programme">The System</a><br>


                            </div>

<div class="title" id="header-wrapper">Content</div>
<div class="title" id="about">Content</div>

<div class="title" id="programme">Content</div>

I have used this script code to show parallax effect. It works perfectly in web but not in mobile devices. How to make it work in mobile devices. Please help

monisha
  • 245
  • 3
  • 17

1 Answers1

0

Use tap event how this:

$('a[href^="#"]').on("tap",function(){
  // Your code
});
oscarvady
  • 450
  • 1
  • 4
  • 12