// JavaScript Document $(document).ready(function(){ //thumbsのカルーセル $('#thumbs').carouFredSel({ synchronise: ['#slides', false, true], auto: false, width: 195, direction : "up", items: { visible: 3, start: -1 }, prev: '#prev', next: '#next' }); //slidesのカルーセル化 $('#slides').carouFredSel({ synchronise: ['#thumbs', true, true], auto: true, items: 1, direction : "up", scroll:{ duration: 700, timeoutDuration: 3000 } }); //サムネールをクリックしたとき $('#thumbs img').click(function() { $('#thumbs').trigger( 'slideTo', [this, -1] ); slidesPlay(); }); //prev,nextをクリックしたとき $('#prev,#next').click(function(){ slidesPlay(); }); //slidesを再開する。 function slidesPlay(){ $('#slides').trigger( 'play' ); if( movieTarget ){ $(movieTarget).html( imgTag ); setSlidesImg( movieTarget ); movieTarget = null; imgTag = null; } } //slidesの機能を設定 var movieTarget; var imgTag; setSlidesImg( "#slides" ); function setSlidesImg( target ){ $('img',target).click( function(){ $( target ).trigger( 'pause' ); var moviePath = $(this).attr('moviePath'); imgTag = $(this).parent().html(); movieTarget = $(this).parent(); var iframeTag = '' $(this).replaceWith( iframeTag ); }); } //一番最初に、サムネールをクリックした時に発生 $('#thumbs').one('click',function(){ $('#slides').animate({ opacity:1 }); $('#selectedMarker').fadeIn('fast'); }); }); //新着情報用カルーセル $(function() { // Basic carousel, no options $('#new').carouFredSel({ scroll:{ duration: 300, timeoutDuration: 4000 } }); }); //Lightbox風表示用 $(function() { function launch() { $('#product').lightbox_me({centered: true, onLoad: function() { $('#try1').find('input:first').focus()}}); } $('#try1').click(function(e) { $("#product").lightbox_me({centered: true, onLoad: function() { $("#product").find("input:first").focus(); }}); e.preventDefault(); }); $('table tr:nth-child(even)').addClass('stripe'); }); $(function() { function launch() { $('#movie').lightbox_me({centered: true, onLoad: function() { $('#try2').find('input:first').focus()}}); } $('#try2').click(function(e) { $("#movie").lightbox_me({centered: true, onLoad: function() { $("#movie").find("input:first").focus(); }}); e.preventDefault(); }); $('table tr:nth-child(even)').addClass('stripe'); });