2015-11-18 23 views
1

我想隱藏基於iPad上物品的觸摸元素。以下鏈接說 - https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html,支持Safari支持ontouchstart屬性,但它不起作用。我們在這種情況下做什麼?我無法使用任何JavaScript。我只需要在html中實現它。ontouchstart不可用於iPad?

我的代碼:

<div class="myclass" id="overlay" ontouchstart="hideElement()" onclick="hideElement()" onmousedown="hideElement()"></div>

回答

0

是不可能直接添加ontouchstart一個HTML元素上。因爲只支持Apple擴展。你可以看到,here

支持水平

蘋果擴展。

你可以使用Jquery或不同的Apple擴展來製作它。您可以在此處找到有關Apple擴展程序的更多詳細信息: https://developer.apple.com/app-extensions/