チェックボックスにチェックしたらコンテンツを表示させる

来源:互联网 发布:gal翻译软件 编辑:程序博客网 时间:2024/05/29 17:06

http://jsfiddle.net/5udtC/9660/

jQuery

$('#check').click(function() {    //クリックイベントで要素をトグルさせる    $("#box").slideToggle(this.checked);});
1$('#check').click(function() {
2    //クリックイベントで要素をトグルさせる
3    $("#box").slideToggle(this.checked);
4});

css

input{margin:80px 0 0 80px;}div{    display:none;    margin:25px;    padding:25px;    background:#eee;    width:200px;    height:150px;}
1input{margin:80px0 0 80px;}
2div{
3    display:none;
4    margin:25px;
5    padding:25px;
6    background:#eee;
7    width:200px;
8    height:150px;
9}

html

<label><input type="checkbox" id="check">Check This!</label><div id="box">content is here</div>

1<label><inputtype="checkbox"id="check">Check This!</label>
2<divid="box">content is here</div>



阅读全文
0 0