[英]Fire click / touchstart event with jqTouch functionality on iPad
我正在使用jqTouch將內容顯示為嵌套列表。 當用戶單擊節點時,jQuery執行ajax調用以獲取新內容並將其放入列表中,然后以編程方式執行對包含此列表的ID的單擊以執行幻燈片。 完整代碼:
$.ajax({
url : 'searchServlet',
type : 'GET',
data : JSON.stringify(jsonParams),
timeout : 2000,
dataType : "json",
error : function(xhr, ajaxOptions, thrownError)
{
console.error("Ajax searchServlet " +xhr.responseText);
},
success : function(searchResult)
{
var results = $("#results_from_server");
results.empty();
for(i=0; i < searchResult.length; i++)
{
$('<li>').append(createVideoItem(searchResult[i].name)).appendTo(results);
}
$('body').append('<a id="tempID" href="#next"></a>');
$('#tempID').click();
$('#tempID').remove();
}
由於點擊限制,它在台式機瀏覽器中可以正常運行,但在iPad上則不能。
所以我的問題是:
$('#tempID').click();
在iPad上工作? 嘗試
$('#tempID').trigger('click');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.