1$(document).ready(function () { 2 3 function isTouchDevice(){ 4 if ('ontouchstart' in window || navigator.msMaxTouchPoints) { 5 $('html').addClass('touch'); 6 } 7 } 8 //run touch test 9 isTouchDevice(); 10 isIEMobile(); 11 12 $("a[rel='lightbox']").colorbox({ 13 scalePhotos: true, 14 maxWidth:"90%", 15 maxHeight:"90%", 16 current: "", 17 fixed: true 18 }); 19 20 $('input, textarea').placeholder(); 21 22 /*top menu*/ 23 24 var time=500; 25 26 function handlerIn(obj) { 27 timer = setTimeout(function() { 28 obj.addClass('sactive'); 29 var tos= obj.find('ul'); 30 tos.slideDown('fast'); 31 if(tos.outerWidth()<tos.parent().outerWidth()){ 32 tos.outerWidth(tos.parent().outerWidth()) 33 } 34 /*if(tos.outerWidth()>tos.parent().outerWidth()){ 35 ver = "-" + (( tos.outerWidth() - tos.parent().outerWidth() )/2) + "px"; 36 tos.css({"margin-left":ver}); 37 }*/ 38 }, time); 39 40 } 41 function handlerOut(obj) { 42 clearTimeout(timer); 43 obj.removeClass('sactive').find('ul').slideUp('fast'); 44 $('html.touch .mainmenu a').removeClass("oneTouch"); 45 } 46 47 $('.mainmenu>li').has('ul').hover( 48 function() { 49 handlerIn($(this)); 50 51 }, 52 function() { 53 handlerOut($(this)); 54 } 55 ); 56 57 /*last dropdown placement fix*/ 58 if( $(".mainmenu>li:last-child>ul").length) 59 { 60 var lo=$(".mainmenu>li:last-child>ul").outerWidth()-$(".mainmenu>li:last-child").outerWidth(); 61 var lo2="-"+lo+"px"; 62 $(".mainmenu>li:last-child>ul").css({"margin-left":lo2}); 63 } 64 /**/ 65 66 67 /*touch menu*/ 68 /* 69 $("html.touch .mainmenu li:has(ul) > a").click(function(e) { 70 e.stopPropagation(); 71 e.preventDefault(); 72 73 if($(this).hasClass("oneTouch")){ 74 $(this).removeClass("oneTouch"); 75 window.location = $(this).attr("href"); 76 } 77 78 else{ 79 $(this).addClass("oneTouch"); 80 $(".mainmenu li ul").hide(); 81 $(this).parent().find("ul").show(); 82 } 83 84 }); 85 86 $("html.touch").click(function(event) { 87 if(!$(event.target).is('html.touch .mainmenu li:has(ul) > a').length) { 88 $('.mainmenu li ul').hide(); 89 $('.mainmenu a').removeClass("oneTouch"); 90 } 91 }); 92 */ 93 /*touch menu*/ 94 95 /*IE MOBILE VIEWPORT FIX*/ 96 function isIEMobile() { 97 var regExp = new RegExp("IEMobile", "i"); 98 var regExp2 = new RegExp("WPDesktop", "i"); 99 if(navigator.userAgent.match(regExp)||navigator.userAgent.match(regExp2)){ 100 var msViewportStyle = document.createElement("style"); 101 msViewportStyle.appendChild( 102 document.createTextNode("@-ms-viewport{width:1280px}") 103 ); 104 document.getElementsByTagName("head")[0].appendChild(msViewportStyle); 105 } 106 } 107 /*IE MOBILE VIEWPORT FIX*/ 108 109 //$("a[href^='http://']").attr("target","_blank"); 110 $('a').each(function() { 111 var a = new RegExp('/' + window.location.host + '/'); 112 if (!a.test(this.href)) { 113 $(this).attr("target","_blank"); 114 } 115 }); 116 117//end document.ready 118});
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.