/* * Copyright (c) DESIGN inc. All Rights Reserved. * http://www.design-inc.jp/ * */ jQuery(function($){ // Googleマップを#googlemapに挿入 if($('#googlemap').length){ $('#googlemap').css({ 'width': '100%', 'height': '400px' }); var lat = '36.178449'; var lng = '139.549284'; if (lat && lng) { var latlng = new google.maps.LatLng(lat, lng); var mapOptions = { zoom: 15, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map($('#googlemap').get(0), mapOptions); var marker = new google.maps.Marker({map: map, position: latlng}); } else { $('#googlemap').remove(); } } // liとtrの奇数・偶数・最初・最後にクラス付与(odd, even, first, last) $('li:nth-child(odd), tr:nth-child(odd)').addClass('odd'); $('li:nth-child(even), tr:nth-child(even)').addClass('even'); $('li:first-child, tr:first-child').addClass('first'); $('li:last-child, tr:last-child').addClass('last'); // ページ内スクロール $('a.scroll').click(function(){ $('html,body').animate({scrollTop: $($(this).attr('href')).offset().top }, {'duration': 400, 'easing': 'easeOutCubic', 'queue': false}); return false; }); // 外部リンクに「target="_blank"」付与(クラス「a.noblank以外」) $('a[href^=http]').not('[href*="'+location.hostname+'"]').not('a.noblank').attr('target', '_blank'); // jquery.rollOver.js $.fn.rollOver({ animateTime: 300, fadeOpacity: 0.7, easing: 'easeOutCubic' }); // jquery.slideImage.js $('.detailpage-left').slideImage({ thumbnailWidth: 60, animateTime: 300, easing: 'easeOutCubic' }); // jquery.cross-slide.min.js if($('#cross-slide').length){ $('#cross-slide').crossSlide({ sleep: 2, fade: 1, loop: 1 }, [ { src: '/data/images/data-120806233641.jpg' }, { src: '/data/images/data-120806233641.jpg' }, { src: '/data/images/data-120806233641.jpg' }, { src: '/data/images/data-120806233641.jpg' }, { src: '/data/images/data-120806233641.jpg' } ]); } // jquery.droppy.js $('.gnav-ul').droppy(); // fixHeight.js $('.fixHeight').fixHeight(); //////////////////////////////////////////////////////////// // 以下スマホサイト設置済みの場合に表示 //////////////////////////////////////////////////////////// var userAgent = navigator.userAgent; var domain = 'http://www.tac-casting.com'; // iPhone、Androidの場合は振り分けを判断 if(document.referrer.indexOf(domain) == -1 && ((userAgent.indexOf('iPhone') > 0 && userAgent.indexOf('iPad') == -1) || userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0)){ if(confirm('スマートフォン用のページを表示しますか?')){ location.href = '/sp/'; } } // PCサイトのフッターにスマホサイトへのリンク if ((userAgent.indexOf('iPhone') > 0 && userAgent.indexOf('iPad') == -1) || userAgent.indexOf('iPod') > 0 || userAgent.indexOf('Android') > 0 ) { $('body').append(''); } });