【问题标题】:Hide div when looking at page on Android or Apple在 Android 或 Apple 上查看页面时隐藏 div
【发布时间】:2013-07-14 02:32:54
【问题描述】:

我正在尝试让 div 在我使用 android 时隐藏或不显示。

我在这里使用代码http://jsfiddle.net/Gajotres/xHA46/

$(document).on('pageshow', '#index', function(){       
var agent = navigator.userAgent;      
var isAndroid = (agent.indexOf("Android")  > 0);     

if (isAndroid ){ 
    $("div.instruction").show();
}    
});

但我不确定如何让它隐藏而不是显示。

我只是把 hide() 而不是 show() 吗?

【问题讨论】:

  • 作为程序员的一部分是尝试做事。我很惊讶你没有尝试你的想法。有什么不好的?

标签: javascript jquery html css cross-browser


【解决方案1】:

是的,只需使用.hide()

阅读http://api.jquery.com/hide/了解更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-08
    • 2012-08-26
    • 1970-01-01
    • 2016-05-27
    相关资源
    最近更新 更多