JS メモ web

<script type="text/javascript">
/* 消し */
$(document).ready(function(){
jQuery("#got").delay(7000).fadeOut(1000);
});
</script>


<script>
/*-- 画面サイズ ピシャリ ---*/
$(function(){
$(document).ready(function(){
hsize = $(window).height();
$("#to_img").css("height",hsize + "px");
});

$(window).resize(function(){
hsize = $(window).height();
$("#to_img").css("height", hsize + "px");
});
});

$(function(){
$(document).ready(function(){
hsize = $(window).height();
$(".menu").css("height", hsize + "px");
});

$(window).resize(function(){
hsize = $(window).height();
$(".menu").css("height", hsize + "px");
});
});

/*-- タブ Js --*/
$(function(){
'use strict';
var menuItems = document.getElementsByClassName('menu_item');
var contents = document.getElementsByClassName('tab_content');

var i;

for(i = 0; i < menuItems.length; i++) {
menuItems[i].addEventListener('click',function(e){
// イベントのデフォルト動作を無効化
e.preventDefault();

var i;

for(i = 0;i < menuItems.length; i++) {
menuItems[i].className = 'menu_item';
}

this.className = 'menu_item active';

for(i = 0;i < contents.length;i++) {
contents[i].className = 'tab_content';
}

document.getElementById(this.dataset.id).className = 'tab_content active';
});
}
});
</script>