1// global.js 2 3// ãã¼ãæã®å¦ç =================================== 4$(function(){ 5 winClass(); // ç¾å¨ã®ã¦ã¤ã³ãã¦å¹ ã«å¿ããå¦ç 6 selectNav(); // ãã«ãã¦ã³ã¡ãã¥ã¼ 7 globalNav(); // ã¹ããçã°ãã¼ãã«ãã 8 pagescroll(); // æ±ç¨ãã¼ã¸ã¹ã¯ãã¼ã©ã¼ 9 limit(); // æåæ°å¶é 10 //foot_icon(); // ãã¼ã¸ä¸é¨ã¢ã¤ã³ã³ã¹ã¿ã¤ã« 11 outbrain(); // Outbrain 12 ReLayout(); //ãªãµã¤ãºçµäºæã®ã¿ãªãã¼ããã 13 caption(); // è¨äºç»åãã£ãã·ã§ã³è¨å® 14 bxslider_link(); // bxsliderã®ãªã³ã¯ãChromeã§å¹ããªãç¾è±¡ã®å¯¾ç 15}); 16 17// ãªãµã¤ãºæã®å¦ç =================================== 18$(window).resize(function(){ 19 winClass(); // ç¾å¨ã®ã¦ã¤ã³ãã¦å¹ ã«å¿ããå¦ç 20}); 21 22//ãªãµã¤ãºçµäºæã®ã¿ãªãã¼ããã 23function ReLayout() { 24 var userAgent = navigator.userAgent; 25 var timer = false; 26 27 // ã¹ãã¼ããã©ã³ã®å ´åã¯orientationchangeã¤ãã³ããç£è¦ãã 28 if (userAgent.indexOf("iPhone") >= 0 || userAgent.indexOf("iPad") >= 0 || userAgent.indexOf("Android") >= 0) 29 window.addEventListener("orientationchange", resizeHandler); 30 else 31 window.addEventListener("resize", resizeHandler); 32 33 function resizeHandler() { 34 if (timer !== false) { 35 clearTimeout(timer); 36 } 37 timer = setTimeout(function() { 38 location.reload(); 39 }, 200); 40 } 41} 42 43// ç¾å¨ã®ã¦ã¤ã³ãã¦å¹ ã«å¿ããå¦ç 44function winClass() { 45 var winwidth = $(window).width(); 46 if (winwidth < 768) { 47 if(!jQuery.support.opacity){ 48 return; // IE8以åã¯ã¬ã¹ãã³ã·ããããªã 49 } else { 50 $("body").removeClass("mode_pc").addClass("mode_sp"); 51 var bodyclass = $("body").attr("class"); // ãããã°ç¨å¤æ° 52 imgResize(); // æ±ç¨ã¬ã¹ãã³ã·ãã¤ã¡ã¼ã¸ 53 } 54 } else { 55 if(!jQuery.support.opacity){ 56 return; // IE8以åã¯ã¬ã¹ãã³ã·ããããªã 57 } else { 58 $("body").removeClass("mode_sp").addClass("mode_pc"); 59 var bodyclass = $("body").attr("class"); // ãããã°ç¨å¤æ° 60 imgResize(); // æ±ç¨ã¬ã¹ãã³ã·ãã¤ã¡ã¼ã¸ 61 } 62 } 63} 64 65// æ±ç¨ã¬ã¹ãã³ã·ãã¤ã¡ã¼ã¸(winClass()ããå¼ã³åºã) 66function imgResize() { 67 if ($("body").hasClass("mode_pc")) { 68 $(".imgrsp").each(function(){ 69 var dataSrc = $(this).attr("src").replace("_sp.","_pc."); 70 $(this).attr("src",dataSrc); 71 }); 72 } 73 if ($("body").hasClass("mode_sp")) { 74 $(".imgrsp").each(function(){ 75 var dataSrc = $(this).attr("src").replace("_pc.","_sp."); 76 $(this).attr("src",dataSrc); 77 }); 78 } 79} 80 81// ãã«ãã¦ã³ã¡ãã¥ã¼ 82function selectNav() { 83 $(".pagenav_selectmenu").find("select").change(function(){ 84 var ChangeTxt = $(this).find("option:selected").text(); 85 $(".pagenav_select_txt").text(ChangeTxt); 86 }); 87} 88 89// ã¹ããçã°ãã¼ãã«ãã 90function globalNav() { 91 $(".globalnav_btn").find("a").click(function(){ 92 $("header").toggleClass("header_on_sp"); 93 $(".globalnav").slideToggle(); 94 }); 95 $(".globalnav_close").find("a").click(function(){ 96 $("header").removeClass("header_on_sp"); 97 $(".globalnav").slideUp(); 98 }); 99} 100 101// æ±ç¨ãã¼ã¸ã¹ã¯ãã¼ã©ã¼ 102function pagescroll() { 103 $('.footer_pagetop a,a.footer_pagetop').click(function(){ 104 $('html,body').animate({scrollTop: 0},1000,'easeOutExpo'); 105 return false; 106 }); 107 $('a.scroll,.scroll a').click(function(){ 108 var tagname = $(this).attr('href'); 109 var tagpotion = $(tagname).offset().top; 110 $('html,body').animate({scrollTop: tagpotion},1000,'easeOutExpo'); 111 return false; 112 }); 113} 114 115// åºååç»åºãåã 116//$(window).load(function(){ 117// if($("#ULIZA_INERAD_PLAYER:empty")){ 118// $('.prlink_movie_movie').remove(); 119// $('.footer_banner').css({width: 'auto',float: 'none'}); 120// } 121//} 122 123// æåæ°å¶é 124function limit() { 125 $(".news_doc").each(function(){ 126 var size = 53; 127 var txt = $(this).text(); 128 var suffix = 'â¦'; 129 var b = 0; 130 for(var i = 0; i < txt.length; i++) { 131 b += txt.charCodeAt(i) <= 255 ? 0.5 : 1; 132 if (b > size) { 133 txt = txt.substr(0, i) + suffix; 134 break; 135 } 136 } 137 $(this).text(txt); 138 }); 139} 140 141// ãã¼ã¸ä¸é¨ã¢ã¤ã³ã³ã¹ã¿ã¤ã« 142function foot_icon() { 143 var icon = $(".footer_icon li").length; 144 if(icon === 3 || icon === 6){ 145 $(".prlink .footer_icon li").css({ width : 33 + '%' }); 146 }else if(icon === 4 || icon === 7 || icon === 8 || icon === 11 || icon === 12){ 147 $(".prlink .footer_icon li").css({ width : 25 + '%' }); 148 } 149} 150 151// Outbrain 152function outbrain() { 153 $('.OUTBRAIN').attr('data-widget-id', "AR_1"); 154} 155 156// è¨äºç»åãã£ãã·ã§ã³è¨å® 157function caption() { 158 if($(".wp-caption-text").length){ 159 $(".wp-caption-text").prev("img").css({ 160 margin: '0 auto 10px', 161 display: 'block' 162 }); 163 } 164} 165 166// bxsliderã®ãªã³ã¯ãChromeã§å¹ããªãç¾è±¡ã®å¯¾ç 167function bxslider_link() { 168 $(document).on('mousedown','.bx-viewport a',function(){ 169 var $this = $(this), 170 myHref = $this.attr('href'), 171 myTarget = $this.attr('target'); 172 if(myTarget === '_blank'){ 173 window.open(myHref); 174 }else{ 175 window.location.href = myHref; 176 } 177 }); 178}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.