简体   繁体   中英

jQuery click event only working in landscape(iPad)

I have a click event that only works when I have my iPad in landscape but when I turn it to portrait, it stops working. Can anyone tell me why?

<div id="home_page">
    <div class="full">
        <button class="button" id="func_checks">Functional Checks</button>
    </div>
</div>

$(document).ready(function(){
    $("#func_checks").on("click touchstart", function(){
        $("#header").append("<h1>G-IV Functional Checks</h1>");
        $("#home_page").hide();
        $(".return").show();
        $("#checks_page").show();
    })
})

Modify click handler to:

$("#func_checks").on("click touchstart", function(){
    $("#header").append("<h1>G-IV Functional Checks</h1>");
    $("#home_page").hide();
    $(".return").show();
    $("#checks_page").show();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM