1jQuery(document).ready(function($){ 2 3 var $window = $(window); 4 5 $("a").bind("focus",function(){if(this.blur)this.blur();}); 6 $("a.target_blank").attr("target","_blank"); 7 8 // inner link --------------------------------- 9 $(':is(.post_content, .p-toc) a[href*=#]').click(function() { 10 var speed = 1000, 11 href = $(this).prop("href"), 12 hrefPageUrl = href.split("#")[0], 13 currentUrl = location.href, 14 currentUrl = currentUrl.split("#")[0]; 15 if(hrefPageUrl == currentUrl){ 16 href = href.split("#"); 17 href = href.pop(); 18 href = "#" + href; 19 var target = $(href == "#" || href == "" ? 'html' : href); 20 if( target.length ){ 21 var position = target.offset().top - 30, 22 body = 'html', 23 userAgent = window.navigator.userAgent.toLowerCase(), 24 header_height = $('html.pc .use_header_fix #header, html.mobile .use_mobile_header_fix #header').innerHeight() || 0; 25 console.log(header_height); 26 $(body).animate({ scrollTop: position - header_height }, speed, 'easeOutExpo'); 27 } 28 return false; 29 } 30 }); 31 32 // mega menu ------------------------------------------------- 33 34 // mega menu post list animation 35 $(document).on({mouseenter : function(){ 36 $(this).parent().siblings().removeClass('active') 37 $(this).parent().addClass('active'); 38 var $content_id = "." + $(this).attr('data-cat-id'); 39 $(".megamenu_blog_list .post_list").removeClass('active'); 40 $($content_id).addClass('active'); 41 return false; 42 }}, '.megamenu_blog_list .category_list a'); 43 44 // mega menu basic animation 45 $('[data-megamenu]').each(function() { 46 47 var mega_menu_button = $(this); 48 var sub_menu_wrap = "#" + $(this).data("megamenu"); 49 var hide_sub_menu_timer; 50 var hide_sub_menu_interval = function() { 51 if (hide_sub_menu_timer) { 52 clearInterval(hide_sub_menu_timer); 53 hide_sub_menu_timer = null; 54 } 55 hide_sub_menu_timer = setInterval(function() { 56 if (!$(mega_menu_button).is(':hover') && !$(sub_menu_wrap).is(':hover')) { 57 $(sub_menu_wrap).stop().css('z-index','100').removeClass('active_mega_menu'); 58 clearInterval(hide_sub_menu_timer); 59 hide_sub_menu_timer = null; 60 } 61 }, 20); 62 }; 63 64 mega_menu_button.hover( 65 function(){ 66 if (hide_sub_menu_timer) { 67 clearInterval(hide_sub_menu_timer); 68 hide_sub_menu_timer = null; 69 } 70 if ($('html').hasClass('pc')) { 71 $('#header').addClass('active'); 72 $(this).parent().addClass('active_megamenu_button'); 73 $(this).parent().find("ul").addClass('megamenu_child_menu'); 74 $(sub_menu_wrap).stop().css('z-index','200').addClass('active_mega_menu'); 75 if( $('.megamenu_slider').length ){ 76 $('.megamenu_slider').slick('setPosition'); 77 }; 78 } 79 }, 80 function(){ 81 if ($('html').hasClass('pc')) { 82 if (!$('#header').hasClass('fix_active')) { 83 $('#header').removeClass('active'); 84 } 85 $(this).parent().removeClass('active_megamenu_button'); 86 $(this).parent().find("ul").removeClass('megamenu_child_menu'); 87 hide_sub_menu_interval(); 88 } 89 } 90 ); 91 92 $(sub_menu_wrap).hover( 93 function(){ 94 $('#header').addClass('active'); 95 $(mega_menu_button).parent().addClass('active_megamenu_button'); 96 }, 97 function(){ 98 if (!$('#header').hasClass('fix_active')) { 99 $('#header').removeClass('active'); 100 } 101 $(mega_menu_button).parent().removeClass('active_megamenu_button'); 102 } 103 ); 104 105 106 $('#header').on('mouseout', sub_menu_wrap, function(){ 107 if ($('html').hasClass('pc')) { 108 hide_sub_menu_interval(); 109 } 110 }); 111 112 }); // end mega menu 113 114 115 //return top button 116 var return_top_button = $('#return_top'); 117 $('a',return_top_button).click(function() { 118 var myHref= $(this).attr("href"); 119 var myPos = $(myHref).offset().top; 120 $("html,body").animate({scrollTop : myPos}, 1000, 'easeOutExpo'); 121 return false; 122 }); 123 return_top_button.removeClass('active'); 124 $window.scroll(function () { 125 if ($(this).scrollTop() > 100) { 126 return_top_button.addClass('active'); 127 } else { 128 return_top_button.removeClass('active'); 129 } 130 }); 131 132 133 //fixed footer content 134 var fixedFooter = $('#fixed_footer_content'); 135 fixedFooter.removeClass('active'); 136 $window.scroll(function () { 137 if ($(this).scrollTop() > 330) { 138 fixedFooter.addClass('active'); 139 } else { 140 fixedFooter.removeClass('active'); 141 } 142 }); 143 $('#fixed_footer_content .close').click(function() { 144 $("#fixed_footer_content").hide(); 145 return false;
146 }); 147 148 149 // comment button 150 $("#comment_tab li").click(function() { 151 $("#comment_tab li").removeClass('active'); 152 $(this).addClass("active"); 153 $(".tab_contents").hide(); 154 var selected_tab = $(this).find("a").attr("href"); 155 $(selected_tab).fadeIn(); 156 return false; 157 }); 158 159 160 //custom drop menu widget 161 $(".tcdw_custom_drop_menu li:has(ul)").addClass('parent_menu'); 162 $(".tcdw_custom_drop_menu li").hover(function(){ 163 $(">ul:not(:animated)",this).slideDown("fast"); 164 $(this).addClass("active"); 165 }, function(){ 166 $(">ul",this).slideUp("fast"); 167 $(this).removeClass("active"); 168 }); 169 170 171 // design select box widget 172 $(".design_select_box select").on("click" , function() { 173 $(this).closest('.design_select_box').toggleClass("open"); 174 }); 175 $(document).mouseup(function (e){ 176 var container = $(".design_select_box"); 177 if (container.has(e.target).length === 0) { 178 container.removeClass("open"); 179 } 180 }); 181 182 183 //tab post list widget 184 $(".tab_post_list_widget").each(function () { 185 $('.widget_tab_post_list_button a:first-child',this).addClass('active'); 186 $('.widget_tab_post_list:first',this).show(); 187 }); 188 $('.widget_tab_post_list_button').on('click', 'a', function(){ 189 $(this).addClass('active'); 190 $(this).siblings().removeClass('active'); 191 var $tab_list_class = "." + $(this).attr('data-tab'); 192 $(this).closest('.tab_post_list_widget').find(".widget_tab_post_list").hide(); 193 $(this).closest('.tab_post_list_widget').find($tab_list_class).show(); 194 $(this).closest('.tab_post_list_widget').find($tab_list_class).find('ol').slick('setPosition'); 195 return false; 196 }); 197 198 199 //archive list widget 200 if ($('.p-dropdown').length) { 201 $('.p-dropdown__title').click(function() { 202 $(this).toggleClass('is-active'); 203 $('+ .p-dropdown__list:not(:animated)', this).slideToggle(); 204 }); 205 } 206 207 208 //category widget 209 $(".tcd_category_list li:has(ul)").addClass('parent_menu'); 210 $(".tcd_category_list li.parent_menu > a").parent().prepend("<span class='child_menu_button'></span>"); 211 $(".tcd_category_list li .child_menu_button").on('click',function() { 212 if($(this).parent().hasClass("open")) { 213 $(this).parent().removeClass("active"); 214 $(this).parent().removeClass("open"); 215 $(this).parent().find('>ul:not(:animated)').slideUp("fast"); 216 return false; 217 } else { 218 $(this).parent().addClass("active"); 219 $(this).parent().addClass("open"); 220 $(this).parent().find('>ul:not(:animated)').slideDown("fast"); 221 return false; 222 }; 223 }); 224 225 226 //search widget 227 $('.widget_search #searchsubmit').wrap('<div class="submit_button"></div>'); 228 $('.google_search #searchsubmit').wrap('<div class="submit_button"></div>'); 229 230 //calendar widget 231 $('.wp-calendar-table td').each(function () { 232 if ( $(this).children().length == 0 ) { 233 $(this).addClass('no_link'); 234 $(this).wrapInner('<span></span>'); 235 } else { 236 $(this).addClass('has_link'); 237 } 238 }); 239 240// ããã¹ãã¦ã£ã¸ã§ããã¨HTMLã¦ã£ã¸ã§ããã«ã¨ãã£ã¿ã¼ã®ã¯ã©ã¹ã追å ãã 241$('.widget_text .textwidget').addClass('post_content'); 242 243// ã¢ã¼ã«ã¤ãã¨ã«ãã´ãªã¼ã®ã»ã¬ã¯ãããã¯ã¹ã«select_wrapã®ã¯ã©ã¹ã追å ãã 244 $('.widget_archive select').wrap('<div class="select_wrap"></div>'); 245 $('.widget_categories form').wrap('<div class="select_wrap"></div>'); 246 247 // header hover 248 $("#header").addClass("off_hover"); 249 $("#header").hover(function(){ 250 $(this).removeClass("off_hover"); 251 }, function(){ 252 $(this).addClass("off_hover"); 253 }); 254 255 256 // header search 257 $("#header_search").hover(function(){ 258 $('> #header_searchform',this).stop().slideDown("fast"); 259 $("#header_search_button").addClass("active"); 260 return false; 261 }, function(){ 262 $('> #header_searchform',this).stop().slideUp("fast"); 263 $("#header_search_button").removeClass("active"); 264 return false; 265 }); 266 267 268// responsive ------------------------------------------------------------------------ 269var mql = window.matchMedia('screen and (min-width: 1151px)'); 270function checkBreakPoint(mql) { 271 272 if(mql.matches){ //PC 273 274 $("html").removeClass("mobile"); 275 $("html").addClass("pc"); 276 277 // lang button 278 $("#header_lang_button").css("display","none"); 279 $("#header_lang_button").toggleClass("active",false); 280 $("#header_lang > ul").show(); 281 $("#header_lang > ul ul").hide(); 282 $("#header_lang li").hover(function(){ 283 $(">ul:not(:animated)",this).slideDown("fast"); 284 $(this).addClass("active"); 285 }, function(){ 286 $(">ul",this).slideUp("fast"); 287 $(this).removeClass("active"); 288 }); 289 290 $(".global_menu_button").css("display","none"); 291 292 $('a.megamenu_button.type2').parent().addClass('megamenu_parent_type2'); 293 $('a.megamenu_button.type3').parent().addClass('megamenu_parent_type3'); 294 295 $("#global_menu li:not(.megamenu_parent)").hover(function(){ 296 if( $(this).hasClass('menu-item-has-children') ){ 297 $(">ul:not(:animated)",this).slideDown("fast"); 298 $(this).addClass("active"); 299 $('#header').addClass("active"); 300 } 301 }, function(){ 302 if( $(this).hasClass('menu-item-has-children') ){ 303 $(">ul",this).slideUp("fast"); 304 $(this).removeClass("active"); 305 $('#header').removeClass("active"); 306 } 307 }); 308 309 } else { //smart phone 310 311 $("html").removeClass("pc"); 312 $("html").addClass("mobile"); 313 314 // lang button 315 var header_lang_button = $('#header_lang_button'); 316 header_lang_button.css("display","block"); 317 $("#header_lang li").off('mouseenter mouseleave'); 318 if( header_lang_button.hasClass("active") ){ 319 $("#header_lang >
319 ul").css("display","block"); 320 $("#header_lang ul ul").css("display","block"); 321 } else { 322 $("#header_lang > ul").css("display","none"); 323 $("#header_lang ul ul").css("display","block"); 324 } 325 header_lang_button.on('click', function(e) { 326 if($(this).hasClass("active")) { 327 $(this).removeClass("active"); 328 $(this).next().find('>ul:not(:animated)').slideUp("fast"); 329 return false; 330 } else { 331 $(this).addClass("active"); 332 $(this).next().find('>ul:not(:animated)').slideDown("fast"); 333 return false; 334 }; 335 }); 336 337 // perfect scroll 338 if ($('#drawer_menu').length) { 339 if(! $(body).hasClass('mobile_device') ) { 340 new SimpleBar($('#drawer_menu')[0]); 341 }; 342 }; 343 344 // drawer menu 345 $("#mobile_menu .child_menu_button").remove(); 346 $('#mobile_menu li > ul').parent().prepend("<span class='child_menu_button'><span class='icon'></span></span>"); 347 $("#mobile_menu .child_menu_button").on('click',function() { 348 if($(this).parent().hasClass("open")) { 349 $(this).parent().removeClass("open"); 350 $(this).parent().find('>ul:not(:animated)').slideUp("fast"); 351 return false; 352 } else { 353 $(this).parent().addClass("open"); 354 $(this).parent().find('>ul:not(:animated)').slideDown("fast"); 355 return false; 356 }; 357 }); 358 359 // drawer menu button 360 var menu_button = $('.global_menu_button'); 361 menu_button.off(); 362 menu_button.removeAttr('style'); 363 menu_button.toggleClass("active",false); 364 365 // open drawer menu 366 menu_button.on('click', function(e) { 367 368 e.preventDefault(); 369 e.stopPropagation(); 370 $('html').toggleClass('open_menu'); 371 372 // fix position for ios 373 var topPosition = $window.scrollTop(); 374 $('body').css({'position':'fixed','top': - topPosition}); 375 376 $('#container').one('click', function(e){ 377 if($('html').hasClass('open_menu')){ 378 $('html').removeClass('open_menu'); 379 380 // clear fix position for ios 381 $('body').css({'position':'','top': ''}); 382 $window.scrollTop(topPosition); 383 384 return false; 385 }; 386 }); 387 388 }); 389 390 }; 391}; 392mql.addListener(checkBreakPoint); 393checkBreakPoint(mql); 394 395 396});
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.