Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/437.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何自动关闭切换按钮_Javascript_Jquery_Css_Html_Twitter Bootstrap - Fatal编程技术网

Javascript 如何自动关闭切换按钮

Javascript 如何自动关闭切换按钮,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> &

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

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>
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();
 }
});