LoginSignup
1
1

More than 5 years have passed since last update.

javascript jqueryメモ

Last updated at Posted at 2015-12-02

javascriptのメモ

ページロード時に指定したアンカーへ移動する

$(document).ready(function() {
// チェックエラー時
if( <?php echo $model->countErrMessages() ?> > 0){
obj = document.getElementById("form_area");
y = obj.offsetTop;
scrollTo(0,y);
}
});

diplay:noneした項目をチェックボックス押下時に表示/非表示にする

`$(function(){
  // 基準
  $("#check_11").click(function() {
    $("#hid_check").slideToggle(this.checked);
  });

});`

チェックボックスのチェックされているか確認する

    `if($("#check_11").prop("checked") ){
      $("#hidetc_check").slideToggle(this.checked);
    };`

文法メモ

$(function(){
xxxx;
xxxx;
});

意味:

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1