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

iOS7 click events don't reach the links within the pages #11

Closed shinefour closed 10 years ago

shinefour commented 10 years ago

hey. First of all. great plugin. Thanks for your work. I noticed though, that ... iOS7 click events don't reach the links within the pages

even on http://stereobit.github.io/dragend/ the links won't get triggered in iOS7.

any idea? Thanks

Stereobit commented 10 years ago

Hi,

thanks for pointing this out. You can prevent this by overwriting the hammer settings with in the settings with

{
// other settings
    hammerSettings     : {
          drag_min_distance: 0,
          css_hacks        : false,
          prevent_default  : false
    }
}

~ Tobi

Stereobit commented 10 years ago

Please let me know if this helps.

shinefour commented 10 years ago

Hey Tobi,

sadly this didn't work for me. In the end I had to assign something like the following to make the gesture come through. It doesn't yet work great on Firefox, but at least iOS and Android work.

var clickSimulator = function ( evt ){
  // prevent this from working on Computers
  if( evt.type != 'click' ){
    var theEvent = document.createEvent('MouseEvents');
    theEvent.initEvent( 'click', true, true );
    evt.target.dispatchEvent( theEvent );
    evt.stopPropagation();
    evt.preventDefault();
  }
};
$( ".mosaic-item" ).on( 'tap', clickSimulator );

http://pre.ciudadvirtual.tv

If you have any other insight please let me know. ~ Daniel

Stereobit commented 10 years ago

Should be fixed in the new version.