gpt4 book ai didi

javascript - 如何自动关闭切换按钮

转载 作者:行者123 更新时间:2023-11-28 11:21:00 26 4
gpt4 key购买 nike

我想自动关闭切换按钮,无论我选择什么产品都应该关闭。当点击时应该显示该产品。

HTML

<div class="heading" id="seamless" style="display: none;">
<center>PayPal now accepted! Make a sale and we'll email you to claim your funds. Easy!Your email: admin@example.com</center>
</div>

切换按钮

<div id="normal-toggle-button">
<input name="open" value="1" type="checkbox" onchange="checkshowhidereverse(this.status, '#seamless');checkshowhidereverse(this.status, '#setup');" checked="checked" />
</div>

Javascript

$(document).ready(function () {
//* toggle buttons
toggle_buttons.init();
});

Javascript 函数

//* toggle buttons
toggle_buttons = {
init: function () {
$('#normal-toggle-button').toggleButtons();
}
};

最佳答案

我不太确定我是否理解得很好?

最初 DIV 是隐藏的,未选中复选框?如果是的话这个怎么样

http://jsfiddle.net/8sCw8/

<div class="heading" id="seamless" style="display: none;">
<center>PayPal now accepted! Make a sale and we'll email you to claim your funds. Easy!Your email: admin@example.com</center>
</div>

<div id="normal-toggle-button">
<input id="checkBox" name="open" value="1" type="checkbox"/>
</div>

JS:

$('#checkBox').click(function() {
if( $(this).is(':checked')) {
$("#seamless").show();
} else {
$("#seamless").hide();
}
});

关于javascript - 如何自动关闭切换按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21549873/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com