Javascript 如何自动关闭切换按钮
我想被切换按钮自动关闭,无论我将选择该产品应关闭。当点击时,应该显示该产品 HTMLJavascript 如何自动关闭切换按钮,javascript,jquery,css,html,twitter-bootstrap,Javascript,Jquery,Css,Html,Twitter Bootstrap,我想被切换按钮自动关闭,无论我将选择该产品应关闭。当点击时,应该显示该产品 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 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>
Javascript函数
<div id="normal-toggle-button">
<input name="open" value="1" type="checkbox" onchange="checkshowhidereverse(this.status, '#seamless');checkshowhidereverse(this.status, '#setup');" checked="checked" />
</div>
//* toggle buttons
toggle_buttons = {
init: function () {
$('#normal-toggle-button').toggleButtons();
}
};
我不太清楚我是否理解得很好 初始DIV是隐藏的,是否选中复选框?如果是,这个怎么样
//* toggle buttons
toggle_buttons = {
init: function () {
$('#normal-toggle-button').toggleButtons();
}
};
<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>
$('#checkBox').click(function() {
if( $(this).is(':checked')) {
$("#seamless").show();
} else {
$("#seamless").hide();
}
});