$(function(){ set_fade("top_slide", 5000); /* ■■■■■■ トップギャラリーセット ■■■■■■ */ galleryLI = new Array(); $('.top_gallery').each(function(i){ galleryLI[i] = $(this).find('li'); $(this).find('li').on('click', function(){ $('.popup figure').html( '
' + $(this).attr('data-custmer') + '
' + $(this).html() ); $('.popup').fadeIn(300); nowIndex = $(this).index(); nowgallery = i; }); }); $('.popup .next').on('click', function(){ nowIndex++; if( nowIndex >= galleryLI[nowgallery].length ) nowIndex = 0; $('.popup figure').html( '' + galleryLI[nowgallery].eq(nowIndex).attr('data-custmer') + '
' + galleryLI[nowgallery].eq(nowIndex).html() ); }); $('.popup .prev').on('click', function(){ nowIndex--; if( nowIndex < 0 ) nowIndex = galleryLI[nowgallery].length - 1; $('.popup figure').html( '' + galleryLI[nowgallery].eq(nowIndex).attr('data-custmer') + '
' + galleryLI[nowgallery].eq(nowIndex).html() ); }); $('.popup .close, .popup').on('click', function(){ $('.popup').fadeOut(300); }); $('.popup > div').on('click', function(e){ e.stopPropagation(); }); /* ■■■■■■ スライドショーセット ■■■■■■ */ slideNum = 0; $slideList = $('.slideshow_list li'); $(window).on('resize load',function(){ if( $(this).width() < 584 ){ $('.slideshow_list ul').css('width', $slideList.length * 100 + '%'); $slideList.css('width', ( 100 / $slideList.length ) + '%'); }else{ $('.slideshow_list ul').css('width', ''); $slideList.css('width', ''); } }); $('.slideshow_list .next').on('click', function(){ slideNum++; if( slideNum >= $slideList.length ) slideNum = 0; $('.slideshow_list ul').animate({left: -slideNum + "00%"}, 300); }); $('.slideshow_list .prev').on('click', function(){ slideNum--; if( slideNum < 0 ) slideNum = $slideList.length - 1; $('.slideshow_list ul').animate({left: -slideNum + "00%"}, 300); }); /* ■■■■■■ スマホバナー表示 ■■■■■■ */ $('.topics nav .more').css("cursor","pointer").on('click', function(){ $('.topics > nav a').each( function(i){ setTimeout("$('.topics > nav a').eq(" + i + ").fadeIn(300)", i*50); }); $(this).fadeOut(500); }); /* ■■■■■■ サロン切り換え ■■■■■■ */ $('.salon_box .folder_links a').on('click', function(){ if( !$('this').hasClass('on') ){ $('.salon_all article').removeClass('on'); $('.salon_all article').eq($(this).index()).addClass('on'); } }); }); /* ■■■■■■ Webカメラリロード ■■■■■■ */ $(document).ready(function() { window.setInterval("refreshCamera();", 10000); // one second interval }); var url = 'http://108.174.35.66:5015/SnapshotJPEG?Resolution=640x480&Quality=Motion'; var forcerefresh = 0; function refreshCamera() { forcerefresh = forcerefresh + 1; $('#webcam').attr('src',url + forcerefresh); } /* ■■■■■■ fade ■■■■■■ */ Fades = new Array(); //ID内のタグエレメント用(配列変数) nowFade = new Array(); //現在表示中の番号用(配列変数) fadeDelay = new Array(); //フェードの間隔用(配列変数) setTO = new Array(); //setTimeout用(clearTimeoutでキャンセルするために用意) /* ■■■■ 初期設定(
タグエレメント読み込み、イベントハンドラ設置など) ■■■■ */ function set_fade(ID, Delay){ Fades[ID] = document.getElementById(ID).getElementsByTagName("li"); //Fades[ID] に、
タグエレメントにclass="on"を付けるスクリプト ■■■■ */ function fade_change(ID,NUM){ clearTimeout(setTO[ID]); //ここで、いったん、前に設定された 「setTimeout("fade_next('" + ID + "')", fadeDelay[ID])」をキャンセル。 Fades[ID][nowFade[ID]].className = ""; //現在表示中(nowFade[ID])の