2017-05-15 8 views
0

나는 아래에이 기능이 있지만 iphone6에서 작동하지 않습니다 :jQuery iPhone 용 클릭 터치?

$(document).on("click touch", "a[href^='#']", function (e) { 
    var id = $(this).attr("href"); 
    if ($(id).length > 0) { 
    e.preventDefault(); 

    // trigger scroll 
    scrollMagicController.scrollTo(id); 

     // if supported by the browser we can even update the URL. 
    if (window.history && window.history.pushState) { 
     history.pushState("", document.title, id); 
    } 
    } 
}); 

내가 vclick을 시도 :

$(document).on("vclick"... 

를하지만 여전히 작동하지 않습니다.

아이디어가 있으십니까?

답변

0

내가 더 "터치"사용이없는 생각 :-(...

$(document).on("click tap", "a[href^='#']", function (e) { 
    var id = $(this).attr("href"); 
    if ($(id).length > 0) { 
    e.preventDefault(); 

    // trigger scroll 
    scrollMagicController.scrollTo(id); 

     // if supported by the browser we can even update the URL. 
    if (window.history && window.history.pushState) { 
     history.pushState("", document.title, id); 
    } 
    } 
}); 
+0

감사 "탭"하지만 여전히 작동하지 않습니다 – laukok