Skip to content

Still cannot click on href on touchscreens #200

@sitoexpress

Description

@sitoexpress

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: #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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions