2012-05-07 32 views
0

我使用在Stack Overflow上學到的資源在這裏找到示例腳本:http://www.netcu.de/jquery-touchwipe-iphone-ipad-libraryJquery Touchwipe

如果我使用下面的刷卡功能,在Android上失敗,用戶控制箭頭不會在Android或PC的工作(我沒有一個iPhone來進行測試):

​​

如果我用這個,那麼用戶控制箭頭在PC和Android工作,但刷卡功能仍然無法工作:

<script type="text/javascript"> 
$(document).ready(function() { 
$('#imagegallery').cycle({ 
    fx: 'fade', 
    prev: '#prev', 
    next: '#next', 
    speed: 300 
}); 
$("#imagegallery").touchwipe({ 
    wipeLeft: function() { 
     $("#imagegallery").cycle("next").alert("left"); 
    }, 
    wipeRight: function() { 
     $("#imagegallery").cycle("prev").alert("right"); 
    } 

}); 
}); 
var swipeOptions = { 
swipe  : swipe, 
threshold : 75 
} 

</script> 

我什麼都試過了我能想到的做我自己的學習和實驗,但在這一點上,我真的可以用正確的方向推動。我在我兒子的網站上使用測試頁面:http://zachmcdonald.net/testgallery.php

感謝您的想法! 謝謝, 朱莉

回答

1

我發現它簡單做以下

$("#imagegallery").touchwipe({ 
    wipeLeft: function() { 
    $("#imagegallery .Next").click(); // selector for you 'next' btn 
    }, 
    wipeRight: function() { 
    $("#imagegallery .Previous").click() // selector for your 'prev' btn; 
    } 
}); 
+0

謝謝,我肯定會給一個試試吧! :) –