1/** 2 * å ¨ãã¶ã¤ã³ãµã¤ãå ±éJS 3 * @author nagai 4 * @version 1.0 5 */ 6$(function(){ 7 8 $(window).on('load', function() { 9 $('.footer-address-body').attr('x-ms-format-detection', 'none'); 10 }); 11 12 // ãã¹ãã¼ããã©ã³çã表示ããã¿ã³ãä¸ã¹ã¯ãã¼ã«æã«é ã 13 var oldScrollPos = 0; 14 $(window).scroll(function() { 15 var currentScrollPos = $(this).scrollTop(); 16 if (currentScrollPos <= oldScrollPos) { 17 $('#smartphone').removeClass('scrollHide'); 18 } else { 19 $('#smartphone').addClass('scrollHide'); 20 } 21 oldScrollPos = currentScrollPos; 22 }); 23 24 //ã¹ã ã¼ãºã¹ã¯ãã¼ã« 25 $("a[href*='#'].scroll").smoothScroll(); 26 27 //ãã¡ã¤ã«ãªã³ã¯ã¯å¥çªè¡¨ç¤º 28 //$("a[href*='.*']").fileBlank('*') ã»ã¬ã¯ã¿ã§æ¡å¼µåæå® fileBlankã®å¼æ°ã«ã¯ã©ã¹æå®; 29 $("a[href*='.pdf']").fileBlank('pdf'); 30 $("a[href*='.doc']").fileBlank('word'); 31 $("a[href*='.xls']").fileBlank('excel'); 32 33 // ãã¡ã¤ã«ãªã³ã¯ã®ã¯ãªãã¯ã¤ãã³ãè¨æ¸¬ 34 $('.file-link-item a').on('click',function(){ 35 var targetUrl = $(this).attr('href'); 36 var targetLabel = $(this).text(); 37 // gaæªå®ç¾©ã®å ´åã¯å®è¡ããªã 38 if(typeof ga == 'function'){ 39 ga('send', 'event', targetUrl, 'download', targetLabel); 40 } 41 // gtagæªå®ç¾©ã®å ´åã¯å®è¡ããªã(GA4) 42 if(typeof gtag == 'function'){ 43 gtag('event', 'sv_file_link_click', { 44 'event_category': 'file_download_category', 45 'event_label': targetLabel + 'ï¼' + targetUrl, 46 'value': 1 47 }); 48 } 49 }); 50 51 //ãã¼ã«ãªã¼ãã¼ç»å 52 $("img[src*='_off.']").rollOver({off:'_off.',on:'_on.'}); 53 54 //object-fité©ç¨å¯¾è±¡ã®ç»å 55 objectFitImages('.ofi-wrapper img'); 56 57 58 // //XPã®IE7ã¨ä»ã®OSã«ã¡ã¤ãªãªã®ãã©ã³ãæå® 59 // $.fn.fontMeiryo(); 60 61 //tableã®align屿§åé¤ 62 $.fn.tableDeleteAlign(); 63 64 // // å¥ãã¡ã¤ã³ã¯å¥çªè¡¨ç¤º 65 // $('a[href*=http]').linkBlank({url:['/www.xxxx.xxxx.xxxx.jp' ,'/xxxx.xxxx.xxxx.jp' ,'^http://www00.dev.smartcms.smart-lgov.jp']}); 66 67 // å ã®ãã¼ã¸ã«æ»ããªãã¡ã©ã¼ãèªåã§ã¤ãã 68 $("a[href*=inquiryId]").each(function() { 69 var a = $(this); 70 var url = a.attr("href"); 71 var locaUrl = location.pathname; 72 a.attr("href", url.replace(/(Init\.do\?inquiryId=[0-9]+)/, '$1&ref=www.xxxx.xxxx.xxxx.jp' + locaUrl) ); 73 }); 74 75 76 var location_href = location.href; 77 var now_site_domain; 78 79 if(!!site_domain && (location_href.indexOf('http://') != -1 || location_href.indexOf('https://') != -1)){ 80 var replace_site_domain = site_domain + '/'; 81 var now_site_domain = replace_site_domain.replace( /http:/g , "" ).replace( /https:/g , "" ); 82 }else{ 83 now_site_domain = ''; 84 } 85 86 //æåãµã¤ãºå¤æ´ï¼æ¨æº or 大ããããï¼HTMLå´ã¯ä»¥ä¸ã®ããã«è¨å® 87 if ($('.scsize').length) { 88 $.fn.styleCatcherUpNormal({btnCls: "scsize",cssID: "scsize",prAry: ['size_default.css', 'size_up.css', 'size_up2.css', 'size_up3.css'],cssPath: now_site_domain + 'theme/base/css/',def: 0}); 89 } 90 91 //èæ¯è²å¤æ´ï¼ç½ãé»ãéï¼ç¨ãã©ã°ã¤ã³ 92 $.fn.styleCatcher = function(config) { 93 config = $.extend({ 94 btnCls: "scsize", 95 cssID: "scsize", 96 cssPath:'/theme/base/css/', 97 def: 0 98 },config); 99 100 var cssTag = $('<link rel="stylesheet" />'); 101 cssTag.attr('id', config.cssID); 102 $("body").append(cssTag); 103 104 function offRollAndOn(_id) { 105 $('.' + config.btnCls).each(function(idx){ 106 var j2 = $(this); 107 var id2 = j2.attr("data-background"); 108 var img2 = j2.find("img"); 109 img2.unbind(); 110 if(_id == id2) { 111 img2.attr("src", img2.attr("src").replace("_off.", "_on.")); 112 } 113 else { 114 img2.attr("src", img2.attr("src").replace("_on.", "_off.")); 115 img2.hover(function () { 116 $(this).attr("src", $(this).attr("src").replace("_off.", "_on.")); 117 },function () { 118 $(this).attr("src", $(this).attr("src").replace("_on.", "_off.")); 119 }); 120 } 121 }); 122 } 123 $('.' + config.btnCls).attr("href", "#"); 124 $('.' + config.btnCls).click(function(){ 125 var j = $(this); 126 var img = j.find("img"); 127 var id = j.attr("data-background"); // 128 offRollAndOn(id); 129 $('#' + config.cssID).attr("href", config.cssPath + id + '.css'); 130 $.cookie(config.cssID, id, {path:'/'});
131 return false; 132 }); 133 var fileName; 134 if($.cookie(config.cssID)) { 135 fileName = $.cookie(config.cssID); 136 } 137 else { 138 fileName = $($('.' + config.btnCls).get(config.def)).attr("data-background"); 139 } 140 offRollAndOn(fileName); 141 $('#' + config.cssID).attr("href", config.cssPath + fileName + '.css'); 142 }; 143 144 //èæ¯è²å¤æ´ï¼ç½ãé»ãéï¼HTMLå´ã¯ä»¥ä¸ã®ããã«è¨å® 145 if ($('.sccolor').length) { 146 $.fn.styleCatcher({btnCls: "sccolor",cssID: "sccolor", cssPath: now_site_domain + 'theme/base/css/',def: 2}); 147 } 148 149 150 151 152 // ãããã¼ããã®ããããã¡ã㥠153 if (typeof $.fn.dropMenu != 'undefined') { 154 $("#header-nav").dropMenu(); 155 } 156 157 // æåãµã¤ãºå¤æ´ç£è¦ 158 $.fn.fontSizeChange({func:function(){ 159 $(window).trigger('fontSizeChange'); 160 $("#wrapper").show(); 161 }}); 162 163 164 //ã¢ã¼ãã«ï¼ã¡ãã¥ã¼ï¼ 165 $('.menu-btn-menu').lightbox({ 166 modalBg:$('.modal-menu-bg'), 167 modal:$('.modal-menu,.menu-btn-close'), 168 close:$('.modal-menu-close,.menu-btn-close'), 169 scrollID:'sWrapper', 170 lightSpot:$('.menu-btn-menu') 171 }); 172 173 $('.modal-menu .toggle').svAccordion({ 174 classHead:'.title', 175 classBody:'.list', 176 classToggle:'on' 177 }); 178 179 // ã¢ã³ã¼ãã£ãªã³(ãããã質åç¨) 180 $('.faq-block').svAccordion({ 181 classHead:'.title', 182 classBody:'.childs', 183 classToggle:'on' 184 }); 185 186 //ã¢ã³ã¼ãã£ãªã³ï¼åéå¥ã§æ¢ãï¼ 187 $('.joho-tab #tab-6 .in2').svAccordion({ 188 classHead:'.title', 189 classBody:'.links', 190 classToggle:'on' 191 }); 192 193 //ã¹ãããã¬ãã¥ã¼ã«å¯¾å¿ 194 $('.no-escape').each(function(){ 195 $(this).html($(this).text()); 196 }); 197 198 // æ¬æã¸è¡¨ç¤º 199 var toBody = $('.honbun a'); 200 var toBodyOuter = $('.honbun'); 201 toBody.focus(function(){ 202 toBodyOuter.css('top', '0'); 203 }); 204 toBody.blur(function(){ 205 toBodyOuter.css('top', '-999px'); 206 }); 207 208 setTranslateForm(); 209 transformMedia = window.matchMedia("(max-width: 768px)"); 210 211 transformMedia.addListener(setTranslateForm); 212 213 function setTranslateForm() { 214 if(window.matchMedia("(max-width: 768px)").matches) { 215 $('#honyaku').appendTo('#translate-sp'); 216 $('#read-speaker').appendTo('#read-speaker-sp'); 217 } else { 218 $('#honyaku').appendTo('#translate-pc'); 219 $('#read-speaker').appendTo('#read-speaker-pc'); 220 } 221 } 222 223 var printMedia = window.matchMedia('print'); 224 printMedia.addListener(function(){ 225 if (print.matches) { 226 transformMedia.removeListener(setTranslateForm); 227 } else { 228 transformMedia.addListener(setTranslateForm); 229 } 230 }); 231 232 // ----------------------------------------------------- 233 // wysiwygã®ä¸ã«tableãããã°ãwrapperã¯ã©ã¹ãä»ä¸ãã 234 // ï¼100%ãè¶ ããã¨ãã«wrapperå ã§ã¹ã¯ãã¼ã«ãããããï¼ 235 // ----------------------------------------------------- 236 if ($('.wysiwyg table').length){ 237 $('.wysiwyg table').wrap('<div class="table-wrapper"></div>'); 238 } 239 240 241/** 242 IE8,9ã§XMLHttpRequestã®ä»£ããã«XDomainRequestã使ã 243 ãã®ã»ã¯ã·ã§ã³ã¯æ¶ããªãã§ãã ããã 244 */ 245if ( window.XDomainRequest ) { 246 jQuery.ajaxTransport(function( s ) { 247 if ( s.crossDomain && s.async ) { 248 if ( s.timeout ) { 249 s.xdrTimeout = s.timeout; 250 delete s.timeout; 251 } 252 var xdr; 253 return { 254 send: function( _, complete ) { 255 function callback( status, statusText, responses, responseHeaders ) { 256 xdr.onload = xdr.onerror = xdr.ontimeout = xdr.onprogress = jQuery.noop; 257 xdr = undefined; 258 complete( status, statusText, responses, responseHeaders ); 259 } 260 xdr = new XDomainRequest(); 261 xdr.open( s.type, s.url ); 262 xdr.onload = function() { 263 callback( 200, "OK", { text: xdr.responseText }, "Content-Type: " + xdr.contentType ); 264 }; 265 xdr.onerror = function() { 266 callback( 404, "Not Found" ); 267 }; 268 xdr.onprogress = function() {}; 269 if ( s.xdrTimeout ) { 270 xdr.ontimeout = function() { 271 callback( 0, "timeout" ); 272 }; 273 xdr.timeout = s.xdrTimeout; 274 } 275 xdr.send( ( s.hasContent && s.data ) || null ); 276 }, 277 abort: function() { 278 if ( xdr ) { 279 xdr.onerror = jQuery.noop(); 280 xdr.abort(); 281 } 282 } 283 }; 284 } 285 });
286} 287 288 //PCã»ã¹ããåãæ¿ãï¼ã¬ã¹ãã³ã·ãï¼ 289 if( typeof MutualSwitching !== 'undefined') { 290 MutualSwitching.config.setPathSettings({ 291 "/": { 292 "pc_width": 1280, 293 "sp_width": 750, 294 "layout_type": 0 295 } 296 }); 297 MutualSwitching.run.ready(); 298 } 299 300});
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.