1/* ================================================================ 2wclabs.js custom Ver.1.3 3Create: 2009/03/11 4Update: 2010/02/09 5for: jQuery 1.4.1 6================================================================ */ 7 8var func = function(){ 9 10} 11 12var WG_LOAD_FUNC = function(e){ 13 if(e == 0){ //å 容夿´ 14 func(); 15 } 16 else if(e == 1){ //ã¨ãªã¢ç·¨é 17 func(); 18 } 19 else if(e == 2){ //ã¨ãªã¢é¸æ 20 func(); 21 $('body[class*="wc"] .flex > div[id^="k"]').addClass('flex').parent().removeClass('flex'); 22 $('body[class*="wc"] .flex_wrap > div[id^="k"]').addClass('flex_wrap').parent().removeClass('flex_wrap'); 23 $('body[class*="wc"] .flex_wrap2 > div[id^="k"]').addClass('flex_wrap2').parent().removeClass('flex_wrap2'); 24 $('body[class*="wc"] .flex_wrap3 > div[id^="k"]').addClass('flex_wrap3').parent().removeClass('flex_wrap3'); 25 $('body[class*="wc"] .flex_wrap4 > div[id^="k"]').addClass('flex_wrap4').parent().removeClass('flex_wrap4'); 26 } 27}; 28 29(function($) { 30// ãã¡ã³ã¯ã·ã§ã³å®è¡ 31$(function(){ 32 // 33 $('#side').stick_in_parent({ 34 offset_top : 140 35 }); 36 37 // 38 $(window).on('scroll load',function(){ 39 var st = $(window).scrollTop(); 40 var wh = $(window).height(); 41 var fh = $('#globalfooter').offset().top; 42 43 if(st > 10){ 44 $('.pt').fadeIn('normal'); 45 } else { 46 $('.pt').fadeOut('normal'); 47 } 48 49 if((st + wh) > fh){ 50 $('.pt').css({ 51 bottom: ((st + wh) - fh + 60) + 'px' 52 }); 53 } else { 54 $('.pt').css({ 55 bottom: '' 56 }); 57 } 58 59 }); 60 61 62 // 63 $('.service_anc > div').on('mouseover',function(){ 64 var anc = $(this).css('cursor','pointer').attr('data-anc'); 65 $('.service_text > dl').add($('.service_anc > div')).removeClass('open'); 66 $('#' + anc).add($(this)).addClass('open'); 67 }).on('click',function(){ 68 var anc = $(this).attr('data-anc'); 69 var url = $('#' + anc).find('a').attr('href'); 70 if(url){ 71 location.href = url; 72 } 73 }); 74 75 76 var ua = navigator.userAgent; 77 if(!!document.createElement('canvas').getContext('experimental-webgl')){ 78 if (!(ua.indexOf('iPhone') > -1 || ua.indexOf('iPod') > -1 || ua.indexOf('Android') > -1 || ua.indexOf('Mobile') > -1 || ua.indexOf('Windows Phone') > -1 || ua.indexOf('iPad') > -1)) { 79 $('.service_img').ripples({ 80 resolution: 800, 81 dropRadius: 20, 82 perturbance: 0.04, 83 }); 84 } 85 } 86 87 88 // 89 $('.bnr_about,.item_risk').each(function(key,value){ 90 $(value).on('click',function(){ 91 location.href = $(value).find('dd a').attr('href'); 92 }); 93 }); 94 $('.service_text dl,.item_serviceimg').each(function(key,value){ 95 $(value).on('click',function(){ 96 location.href = $(value).find('dt a').attr('href'); 97 }); 98 }); 99 100 $('.item_fileimg').each(function(key,value){ 101 $(value).on('click',function(){ 102 var target = $(value).find('dt a').attr('target'); 103 var wctr_blank = $(value).find('dt a').is('.wctr_blank'); 104 var url = $(value).find('dt a').attr('href'); 105 106 if(url){ 107 if(target == '_blank' || wctr_blank){ 108 window.open($(value).find('dt a').attr('href')); 109 } else { 110 location.href = url; 111 } 112 } 113 return false; 114 }); 115 }); 116 117 // 118 $(".item_fileimg a[href$=xls], .item_fileimg a[href$=xlsx]").addClass("xls"); 119 $(".item_fileimg a[href$=doc], .item_fileimg a[href$=docx]").addClass("word"); 120 $(".item_fileimg a[href$=ppt], .item_fileimg a[href$=pptx]").addClass("ppt"); 121 $(".item_fileimg a[href$=pdf]").addClass("pdf"); 122 $(".item_fileimg a[href$=zip]").addClass("zip"); 123 124 // 125 $('.infiniteslide').each(function(key,value){ 126 $(this).infiniteslide({ 127 speed: 50, 128 direction: key % 2 == 1 ? 'right' : 'left' 129 }); 130 }); 131 var pagetitle = $('#pagetitle_bg').attr('src'); 132 $('#pagetitle').css({ 133 background: 'url(' + pagetitle + ') center top' 134 }); 135 // 136 var $slide = $('#keyvisual_inner'); 137 $slide.find('li').each(function(key,value){ 138 var img = $(this).find('img').attr('src'); 139 $(this).css({ 140 background: 'url(' + img + ') center top' 141 }); 142 }); 143 $slide.on('init',function(){ 144 $('#keyvisual .loader').addClass('loaded'); 145 setTimeout(function(){ 146 $slide.addClass('loaded'); 147 },500); 148 }); 149 150 $slide.slick({ 151 fade: true, 152 autoplay: true, 153 pauseOnFocus: false, 154 pauseOnHover: false, 155 speed: 1500, 156 autoplaySpeed: 5000 157 }); 158 159 $(window).on('scroll load resize',function(){ 160 var st = $(window).scrollTop(); 161 var wh = $(window).height(); 162 163 if($('#keyvisual').length || $('#pagetitle_knowledge').length){ 164 if(st > wh/2){ 165 $('#keyvisual,#globalheader').addClass('scrolled'); 166 } else { 167 $('#keyvisual,#globalheader').removeClass('scrolled'); 168 } 169 if(st != 0){ 170 $('#keyvisual_scroll').addClass('scrolled'); 171 } else { 172 $('#keyvisual_scroll').removeClass('scrolled'); 173 } 174 } else { 175 var pth = $('#pagetitle').outerHeight(); 176 if(pth < st){ 177 $('#globalheader').addClass('scrolled'); 178 } else { 179 $('#globalheader').removeClass('scrolled'); 180 } 181 } 182 183 }); 184 185 186 $('#globalnav_inner > li').on('mouseenter',function(){ 187 $(this).closest('ul').find('div').stop(true,true).fadeOut('normal'); 188 $(this).find('div').stop(true,true).fadeIn('slow'); 189 }).on('mouseleave',function(){ 190 $(this).closest('ul').find('div').stop(true,true).fadeOut('normal'); 191 }); 192 193 $('.fadein').on('inview',function(a,b,c){ 194 if(c == 'top' || c == 'bottom' || b){ 195 $(this).addClass('inview'); 196 } 197 }); 198 199 $(window).scrollTop('0'); 200 201 202 203 $('.section_bg').each(function(key,value){ 204 var img = $(this).find('img').attr('src'); 205 var $this = $(this); 206 $this.css({ 207 background: 'url(' + img + ') center 0 no-repeat' 208 }); 209 $(window).on('scroll',function(){ 210 var ot = $this.offset().top; 211 var sc = $(window).scrollTop(); 212 $this.css({ 213 backgroundPosition: '0 ' + (sc - ot)/5 + 'px' 214 }); 215 }); 216 }); 217 218 219 //èªåã¸ã®ãªã³ã¯ã«ã¯ã©ã¹ä»å 220 $.fn.selflink({ 221 cname: 'current' 222 }); 223 224 //ã¿ã 225 $.fn.tabs({ 226 name : '#tabs', //大ãããã®DIVã®id 227 tabs : '#tabmenu', //ulã«ã¤ããid 228 h: '30px' //ul li aã®height 229 }); 230 231 //ãã¼ã«ãªã¼ãã¼ 232 $.fn.btn({ 233 classname: 'btn', //ãã¼ã«ãªã¼ãã¼ããã¯ã©ã¹ï¼imgã«ä»å ããï¼ 234 ext: '_on' //å ¥ãæ¿ãããã¡ã¤ã«åï¼ä¾ï¼sample_on.jpgï¼ 235 }); 236 237 //Lightbox for jQuery 238 $(window).on('load',function(){ 239 var lb = $('a img').parent('[href$="jpg"],[href$="gif"],[href$="png"],[href$="JPG"],[href$="GIF"],[href$="PNG"]'); 240 241 $.each(lb,function(key,value){ 242 $(this).attr({ 243 'data-title': $(this).attr('alt'), 244 'data-lightbox': 'img' + key 245 }); 246 }); 247 }); 248 249 //ç»åãaltã§æ¶ãããå³ããå·¦ãã 250 $.fn.imgalign({ 251 hidealt: 'disable', //æ¶ãããç»åã«å«ã¾ããæåå
252 rightalt: 'right', //å³ã«å¯ãããç»åã®altã«å«ã¾ããæåå 253 leftalt: 'left' //å·¦ã«å¯ãããç»åã®altã«å«ã¾ããæåå 254 }); 255 256 257 //ç¹æ» åæè¨å® 258 $.fn.blink({ 259 classname: 'blink', //ç¹æ» ããããã¯ã©ã¹å 260 speed: 750 //ç¹æ» ã¹ãã¼ã 261 }); 262 263 //æéç»åç½®æåæè¨å® 264 $.fn.imgreplace({ 265 path: '/common/img/', //ç»åãèªããã£ã¬ã¯ã㪠266 arr: 'replace' //æéç½®æãè¨å®ããã¯ã©ã¹å 267 }); 268 269 270 //ï½·ï¾ï½¯âåæè¨å® 271 $.fn.stars({ 272 speed: 150, //ãã©ãâã®é度 273 opacity: 0.4, //ï½·ï¾ï½¯âã§ã©ããããéæã«ãªãã 274 item: '.shine' //ãã©ãâã¿ã¼ã²ãã 275 }); 276 277 //ã¹ã ã¼ã¹ã¹ã¯ãã¼ã« 278 $.fn.smooth({ 279 time: 500, 280 easing: 'easeOutExpo' 281 }); 282 283}); 284 285 286//ãã¡ã³ã¯ã·ã§ã³æ¬ä½-------------------------------------------------------------------- 287 288 //èªåã¸ã®ãªã³ã¯ 289 $.fn.selflink = function(c){ 290 $.extend({ 291 cname: 'current' 292 },c); 293 294 var URL = function(path){ 295 var e = document.createElement('span'); 296 e.innerHTML = '<a href="' + path + '" />'; 297 return e.firstChild.href; 298 }; 299 300 var Lnk = $('a'); 301 $.each(Lnk,function(key,value){ 302 if(URL(this.href) == location.href){ 303 $(this).addClass(c.cname); 304 }; 305 }); 306 }; 307 308 //ã¿ã 309 $.fn.tabs = function(c) { 310 $.extend({ 311 name : '#tabs', 312 tabs : '#tabmenu', 313 h: '30px' 314 },c); 315 316 //ã¿ãã®ã¯ã©ã¹ä»å 317 var t = $(c.tabs).children('li').children('a'); 318 $.each(t,function(key,value){ 319 $(this).addClass('tab'+key); 320 }); 321 322 //ããã¯ã¹ã®ã¯ã©ã¹ä»å 323 var b = $(c.name).children('div'); 324 $.each(b,function(key,value){ 325 $(this).addClass('box'+key); 326 }); 327 328 329 $(c.name).children(c.tabs).children('li').children('a').addClass('tabmenu'); 330 $('.tabmenu').css('float','left').css('display','block'); 331 332 //ãããã¯ã®ä½ç½®æ±ºã 333 $(c.name).css('position','relative'); 334 $(c.name).children('div').css('position','absolute').css('top',c.h).css('left','0'); 335 336 337 //åæã¢ã¯ãã£ã 338 $(c.name).children(c.tabs).children('li').children('a:eq(0)').addClass('active'); 339 $(c.name).children('div:eq(0)').addClass('active'); 340 341 //ã¢ã¯ãã£ã以夿¶ã 342 $(c.name).children('div').not('.active').hide(); 343 344 //ã¯ãªãã¯æã®å¦ç 345 $(c.name).children(c.tabs).children('li').children('a').click(function(){ 346 $(c.name).children(c.tabs).children('li').children('a').removeClass('active'); 347 $(this).addClass('active'); 348 $(c.name).children('div').removeClass('active'); 349 350 var n = $(c.tabs).children('li').children('a').index(this); 351 $('.box'+n).addClass('active'); 352 353 $(c.name).children('div.active').show(); 354 $(c.name).children('div').not('.active').hide(); 355 356 return false; 357 }); 358 }; 359 360 361//ãã¼ã«ãªã¼ãã¼ï¼åèï¼ãã¬ãã¹ã©ã http://dev.telepath.co.jp/labs/article.php?id=15ï¼ 362 $.fn.btn = function(config){ 363 $.extend({ 364 classname: 'btn', 365 ext: '_on' 366 },config); 367 368 var image_cache = new Object(); 369 $('.'+config.classname).not('[src*="'+config.ext+'."]').each(function(i) { 370 var imgsrc = this.src; 371 var dot = this.src.lastIndexOf('.'); 372 var imgsrc_on = this.src.substr(0, dot) + config.ext + this.src.substr(dot, 4); 373 image_cache[this.src] = new Image(); 374 image_cache[this.src].src = imgsrc_on; 375 $(this).hover( 376 function() { this.src = imgsrc_on; }, 377 function() { this.src = imgsrc; } 378 ); 379 }); 380 }; 381 382//ç»åãaltã§æ¶ãããå³ããå·¦ãã 383 $.fn.imgalign = function(config){ 384 $.extend({ 385 hidealt: 'disable', 386 rightalt: 'right', 387 leftalt: 'left' 388 },config); 389 390 $('img[alt*="'+config.hidealt+'"]').remove(); 391 $('img[alt*="'+config.rightalt+'"]').css('float','right'); 392 $('img[alt*="'+config.leftalt+'"]').css('float','left'); 393 }; 394 395 396//ç¹æ» 397 $.fn.blink = function(config){ 398 $.extend({ 399 classname: 'blink', 400 speed: 750 401 },config); 402 403 setInterval(function() { 404 $('.'+config.classname).toggleClass('wchide'); 405 }, config.speed); 406 }; 407 408//æéç»åç½®æ 409 $.fn.imgreplace = function(config){ 410 $.extend({ 411 path: '/common/img/', 412 arr: 'replace' 413 },config); 414 415 var array = $('.'+config.arr); 416 $.each(array,function(key,value){ 417 var filename = $(this).attr('id'); 418 $(this).empty().append($('<img />
418').attr('src',config.path + filename).addClass('placeimg')); 419 }); 420 }; 421 422// ãã¦ã¹ãªã¼ãã¼ã§ãã©ãâ 423 $.fn.stars = function(config){ 424 config = $.extend({ 425 speed: 150, 426 opacity: 0.4, 427 item: 'a img' 428 },config); 429 430 var target = $(config.item); 431 target.hover(function(){ 432 $(this).animate({opacity:config.opacity},config.speed, 433 function(){ 434 $(this).animate({opacity:1},config.speed); 435 }); 436 }, 437 function(){}); 438 }; 439 440 441 $.fn.smooth = function(config){ 442 config = $.extend({ 443 time: 1000, 444 easing: 'ease-in-out' 445 },config); 446 447 var target, scroll; 448 449 $('.pt a').on("click", function(e) { 450 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 451 target = $(this.hash); 452 target = target.length ? target : $("[id=" + this.hash.slice(1) + "]"); 453 454 455 if (target.length) { 456 scroll = 0; 457 $("html, body").animate({ 458 scrollTop: scroll 459 }, config.time,config.easing); 460 return false; 461 } 462 } 463 }); 464 465 } 466 467 468 469})(jQuery);
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.