tkahn / Smooth-Div-Scroll

A jQuery plugin for smooth scrolling. No longer maintained.
471 stars 184 forks source link

Still cannot click on href on touchscreens #200

Open sitoexpress opened 8 years ago

sitoexpress commented 8 years ago

Hi there,

I'm using smoothdivscroller together with kinetic to move some divs inside a wrapper. Within the div there is an image, around the image there is a href. Something like this.

<wrapper class="film-carousel">
    <div>
         <a href><img></a>
    </div>
    <another div....> <a etcetera> </div>
    <another div....> <a etcetera> </div>
</wrapper>

The problem is: tapping on iPhone/Android phones does not open a link. I managed to find this issue that should be similar to my problem: https://github.com/tkahn/Smooth-Div-Scroll/issues/153

However, I cannot make it work. Below, the plugin settings i'm using:

$(document).ready(function () {
            $(".film-carousel").smoothDivScroll({
                manualContinuousScrolling: true,
                hotSpotScrollingInterval: 30,
                touchScrolling: true
                        });

             // remove smoothDivScroll hotspots on touchscreen
        var hasTouch;
        window.addEventListener('touchstart', function setHasTouch () {
            hasTouch = true;
                $(".film-carousel").smoothDivScroll({
                    hotSpotScrolling: false,
                });    
        window.removeEventListener('touchstart', setHasTouch);
        }, false);

        $('.film-carousel').kinetic({
                filterTarget: function(target, e){
                if (!/down|start/.test(e.type)){
                return !(/area|a|input/i.test(target.tagName));
                    }
                }
            });
});

Am I doing something wrong?

pursuitofepic commented 8 years ago

I'm having this issue too. It's really causing a problem with my mobile users.