jQuery移动显示和隐藏似乎不适用于iPhone

Was*_*sim 0 iphone show-hide jquery-mobile

我正在尝试使用jQuery show并隐藏哪些似乎在Safari中正常工作,当我在iPhone上试用它时,它根本不起作用.这是我的代码;

<script type="text/javascript">

$("#showSearch").click(function () {
  $("#searchform").show(1000);

});
</script>
Run Code Online (Sandbox Code Playgroud)

这是一个按钮,单击该按钮将显示搜索表单.该表格未在iPhone上显示.此外,当我$('#showSearch').remove();在那里添加时,它不会被删除,即使我添加一个函数,因为它的第二个参数show()仍然没有隐藏按钮.

谢谢你的帮助.

Phi*_*ord 7

jQuery文档:

实例:

JS

$('#viewMeButton').click(function() {
   $('#viewMe').toggle(); // used toggle instead of .show() or .hide()
});

$('#removeMeButton').click(function() {
   $('#removeMe').remove(); 
});
Run Code Online (Sandbox Code Playgroud)

HTML

<div data-role="page" id="home">
    <div data-role="content">
        <div id="viewMe">
            Hello I'm in the div tag, can you see me?
        </div>
        <br />
        <button id="viewMeButton">Show / Hide</button>
        <br />
        <div id="removeMe">
            Click the button to remove me
        </div>
        <br />
        <button id="removeMeButton">Remove Me</button>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)