jQuery單擊事件在iOS中不起作用第二次更新:看起來我的一個函數(resetFigures)阻止了事件處理程序,因此將其移動到bind函數的末尾就將其排序。更新:我在經過一些基本測試后意識到點擊事件正在注冊,只是在點擊時盒子無法翻轉。我的網站基本美學功能在Chrome和Firefox中運行,但它拒絕在iOS上正常運行(在帶有iOS 6.1的iPhone 4和帶有iOS 4.3.5的iPad上進行測試)。您可以在此處查看該站點,當然還有腳本(main.js):http://bos.rggwebdesigns.com/我已經讀過iOS并沒有真正正確處理jQuery點擊事件,但我很難找到解決方法。Stack Overflow上的一些線程提到了live()方法,但實現它如下(以及添加onclick=""到可點擊元素)似乎不起作用:$('.card').live('click touchstart', function() {
var figure = $(this).children('.back');
var button = figure.find('.button');
var column = $(this).parents().eq(1);
$('.column').removeAttr('style');
column.css('z-index', 2000);
resetFigures();
if(flipCard(this)){
swoosh.pause();
swoosh.currentTime = 0;
swoosh.play();
}
});我還遇到了這個有趣的解決方案項目:http://aanandprasad.com/articles/jquery-tappable/。但是,我也沒有運氣:$('.card').tappable(function() {
var figure = $(this).children('.back');
var button = figure.find('.button');
var column = $(this).parents().eq(1);
$('.column').removeAttr('style');
column.css('z-index', 2000);
resetFigures();
if(flipCard(this)){
swoosh.pause();
swoosh.currentTime = 0;
swoosh.play();
}
});此外,如果我被誤導,請糾正我,但根據此網站,iOS支持3D轉換,并提供相應的前綴:http://caniuse.com/transforms3d
- 3 回答
- 0 關注
- 973 瀏覽
添加回答
舉報
0/150
提交
取消