/** * ========================================================================== * * [javascript for TRACK-TOKYO] * * ========================================================================== */ /** * strict対策blank open */ function blankOpen(url) { window.open(url); } /** * preload */ jQuery.preimg = function() { for(var i = 0; i < arguments.length; i++) { $('').attr('src', arguments[i]); } }; /** * GET値の取得 */ var qsParm = new Array(); function retrieveGETqs() { var query = window.location.search.substring(1); var parms = query.split('&'); for (var i = 0; i < parms.length; i++) { var pos = parms[i].indexOf('='); if (pos > 0) { var key = parms[i].substring(0, pos); var val = parms[i].substring(pos +1); qsParm[key] = val; } } return qsParm; } $(function() { /** * rollover */ var imgCache; $("a > .roImg").hover(function() { var imgSrc = $(this).attr('src'); var imgSrcDot = imgSrc.lastIndexOf('.'); var imgSrcOver = imgSrc.substr(0, imgSrcDot) + '_on' + imgSrc.substr(imgSrcDot, 4); imgCache = imgSrc; $(this).attr('src', imgSrcOver); }, function() { $(this).attr('src', imgCache); }); /** * go to page top */ $('#pageTopBt, .pageTopBt').click(function() { $('html, body').animate({ scrollTop: 0 }, 500); }); /** * li, tdを交互に色を変える * default : #f4f4f4 * 変えたいul,ol,tableなどにclass「alternatelyBg」を指定 */ var alternatelyBgColor = '#f4f4f4'; $('.alternatelyBg li:odd, .alternatelyBg tr:odd').css("background-color", "#f4f4f4"); $('.postTable tr:odd').css('background-color', alternatelyBgColor); $('.listTable tr:odd').css('background-color', alternatelyBgColor); /** * preload image */ jQuery.preimg( // imgソースを記述することで画像を先読みする // 例) // '/images/global/test.jpg' '/images/global/globalmenu01_on.png', '/images/global/globalmenu02_on.png', '/images/global/globalmenu03_on.png', '/images/global/globalmenu04_on.png', '/images/global/globalmenu05_on.png', '/images/global/globalmenu06_on.png', '/images/global/globalmenu07_on.png', '/images/global/sidebarBg_on.gif' ); /** * フォームオブジェクト * frmwidthAhtoを指定したものを自動100%に * 親テーブルにtableWidthAhtoを指定 * 自動リサイズしたいエレメントの入るtdの最初の列にtdAutoを指定 */ $('.frmwidthAhto').width(50); $('.tableWidthAhto').each(function() { var setTdWidth = $(this).find('.tdAuto').width(); $(this).find('.frmwidthAhto').width(setTdWidth); }); /** * PNG support */ //$(document).pngFix(); }); /** * ポップアップウィンドウ */ function popupWindow(url, name, width, height, left, top, resizable, scrollbars) { window.open(url, name, 'width=' + width + ', height=' + height + ', left=' + left + ', top=' + top + ', resizable=' + resizable + ', scrollbars=' + scrollbars); }