Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
485 stars 114 forks source link

Clickable and scrollable vertical #9

Open DonDi1989 opened 10 years ago

DonDi1989 commented 10 years ago

Hi, when i try dragend.js in mobile phone click is not working and also content i cannot scroll vertically inside dragend page that is not working? Is there any solution for that ?

Stereobit commented 10 years ago

Hi,

can you give me some more informations on device, OS and browser? And maybe a jsfiddle example?

~ Tobi

DonDi1989 commented 10 years ago

Android, version 4.1.2. Browsers: Google Chrome Mobile and Firefox Mobile.

Stereobit commented 10 years ago

Thanks, I'll have a look ...

DonDi1989 commented 10 years ago

Stereobit, have you find any solution for these problems ?. Regards

Stereobit commented 10 years ago

@DonDi1989 I've already reproduced some weird behaviour on Android but haven't found the bug jet. I'll try to have a deeper look into this very soon. Maybe I'll find some time next weekend but I can't promise anything.

I am glad about any help :-).

DonDi1989 commented 10 years ago

Thnx anyway :+1:

Stereobit commented 10 years ago

Hi,

sorry for the late response, can you check if disabling prevent_default in the hammer settings helps?

{
// other settings
    hammerSettings     : {
          drag_min_distance: 0,
          css_hacks        : false,
          prevent_default  : false
    }
}
Stereobit commented 10 years ago

Still some problems, will dig deeper ...

kyts commented 10 years ago

Hi Stereobit. What about problem with vertical scrolling? Have you got solution? I've got this problem too.

Stereobit commented 10 years ago

Hey, I was running into some serious issues with touch event on iPhone when scrolling is possible so I had to prevent it. You could reactivate it with removing the event.preventDefault(); on touch move (line 520 right now). But it will possible break the swipe animation on iOS.

kyts commented 10 years ago

I'll try, thanks a lot for the answer. Wish success in your development.

naxeem commented 10 years ago

@Stereobit since direction is defined in the settings why not prevent it based on direction.. if settings is set to horizontal prevent it on vertical touch...

dapullar commented 10 years ago

Has this issue been addressed? Or is there a work around? To enable vertical scrolling when horizontal swipe is active? (touch devices)

EDIT: Line: 399

event.preventDefault();

Commenting out this temporarily fixed this problem, but it introduces a few bugs into the mix, mostly noticeable on touch devices (with my limited testing).

Untested Pseudo Maybe something along the lines of:

while(Math.abs(parsedEvent.distanceY) < this.settings.minDragDistance) {
   event.preventDefault();
}

I'll try out a few things and post back if there is any success.

dvisockas commented 10 years ago

@dapullar have you found something interesting? By the way you pseudo should be while(Math.abs(event.distanceY) < this.settings.minDragDistance) { event.preventDefault(); } parsedEvent gives me undefined so I changed it to event.

Also I have tried

if (Math.abs(event.webkitMovementX) < Math.abs(event.webkitMovementY)) { event.preventDefault(); } But it doesn't work.

ptisdel commented 9 years ago

I solved this; in the _onMove function, right below "event = event.originalEvent || event;" simply add:

       var coords = getCoords(event),
            x = this.startCoords.x - coords.x,
            y = this.startCoords.y - coords.y;

        if (Math.abs(y) > Math.abs(x)) return;
z3d0 commented 9 years ago

@ptisdel cheers, worked for me too

AppCommercialisti commented 9 years ago

Hello Guys, this solves partially for me. In fact I'm facing a bug: having 2 headers in top of the application, when a user scroll the page vertically and then tap with finger on the header, it changes the page horizzontally. It is like if one press a button to change the page horizzontally, but there isn't any button, only clicking the header this happens. Moreover this happens only one time: one scrolls vertically, then if he clicks the header, the page changes, but then in the new page if no one scrolls vertically, then clicking the header nothing happens. The problem is only when one scrolls vertically. Maybe an overlapping problem. Please I need help, I don't know how to solve

Mladja89 commented 7 years ago

@ptisdel Big thanks! This solved it for me on iPad