这是我的第一篇文章。我正在使用不同尺寸的屏幕。在一个可视SM屏幕上,比如iPad/移动的,当我点击一个按钮时,它会为我切换一个div。然而,我想知道如果我的toggle/div在可视SM模式下打开,我让屏幕“响应”,我如何让它在整个屏幕上切换我的div。只有当它打开时。
代码
function Toggle() {
if ($("#btn").click(function () {
($("#open").toggle()); //this will display my "#open div"
($("#open").css('display', 'block'));
$("#div").hide();
}))
else if{
($("#open").is(":visible"))
{
alert("need a holiday!!!"); //this is what i tried to check if the div is open but it does not detect anything
}
// so if #open is opened and the screen is now responsive it should fill the entire screen
}
}
字符串
CSS
<div id="open" class="visible-sm">// contents that are displayed</div>
型
我们将非常感谢您的指导。
3条答案
按热度按时间qv7cva1a1#
假设你有一个id为
#btn
的切换按钮和一个类为#open
的对应内容部分:字符串
gywdnpxw2#
你在找这样的东西吗?
字符串
z18hc3ub3#
嗨,你是不是想喜欢这个
字符串