3

私は、ユーザーがスライド画像を左右にドラッグできるモバイル Web ギャラリーに取り組んでおり、すべてがうまく機能します。

問題は、その中にボタンがある絶対配置でdivをオーバーレイすると、その下のdivのタッチイベントが発生していないように見えることです。オーバーレイ divを試してみpointer-events:none;ましたが、うまくいかないようです。

z-indexの下部にあるdivがそれらを受け取るように、オーバーレイdivを介してタッチイベントを無効にする方法はありますか?

4

1 に答える 1

1

You could catch the touch event on the overlaying div and delegate it to the underlying div to simulate this

$('#myDiv').click(function(event){
event.preventDefault();
$('#myOtherDiv').trigger(event);
});

Something along those lines (either use .trigger or just .click on the underlying div)

于 2012-10-06T07:17:10.647 に答える