$(function(){ //////////////////////// //グローバルメニューのon off var thisURL = window.location.href; setGlovalNavi(); function setGlovalNavi(){ var targetElem= $("#globalNavi li"); var domain = location.host; for (var i = 0; i < targetElem.length; i++) { var targetURL = $(targetElem.get(i)).children().attr("href"); if(thisURL == 'http://' + domain + "/jp/"){ $(targetElem.get(0)).addClass("on"); }else{ if(thisURL.indexOf(targetURL) > 0 && targetURL!="/jp/"){ $(targetElem.get(i)).addClass("on"); $(targetElem.parent()).addClass("on"); } } } } ///////////////////////////////////////////// //mouser over handler $("a.imgOverEffect").hover( function () { $(this).animate({ opacity: 0.7 }, 200 ); }, function () { $(this).animate({ opacity: 1 }, 0 ); } ); ///////////////////////////////////////////// // newsList $('#newsList tr').click( function () { var url = $(this).find('a').attr('href'); //console.log(url); location.href= url; } ); $('#newsList tr').hover( function () { $(this).addClass('over'); }, function () { $(this).removeClass('over'); } ); $("#newsList tr:even").addClass('trColor'); ///////////////////////////////////////////// // zoom $(document).ready(function() { $("#contents div.section:not(#newsDetail) .fancybox").append(''); }); ///////////////////////////////////////////// // fancybox $(".fancybox").fancybox({ padding:6, maxWidth : 920, maxHeight : 900, openEffect:'elastic', wrapCSS : 'fancybox-custom', closeClick : false, showNavArrows: 0, showCloseButton:false, helpers : { title : { type : 'inside' }, overlay : { speedIn : 500, speedOut : 100, opacity : 0.8, css : { 'background-color' : '#000' } } } }); $('#movList a').fancybox({ width: 640, height: 360, minHeight:360, type: 'html', beforeLoad : function () { // build the HTML5 video structure for fancyBox content with specific parameters _videoHref = this.href; // validates if data values were passed otherwise set defaults _videoPoster = typeof $(this.element).data("poster") !== "undefined" ? $(this.element).data("poster") : ""; _videoWidth = typeof $(this.element).data("width") !== "undefined" ? $(this.element).data("width") : 640; _videoHeight = typeof $(this.element).data("height") !== "undefined" ? $(this.element).data("height") : 360; _dataCaption = typeof $(this.element).data("caption") !== "undefined" ? $(this.element).data("caption") : ""; // construct fancyBox title (optional) this.title = _dataCaption ? _dataCaption : (this.title ? this.title : ""); // set fancyBox content and pass parameters this.content = ""; // set fancyBox dimensions this.width = _videoWidth; this.height = _videoHeight; }, afterShow : function () { // initialize MEJS player } }); // });