1jQuery(document).ready(function($){ 2 3 $("a").bind("focus",function(){if(this.blur)this.blur();}); 4 $("a.target_blank").attr("target","_blank"); 5 6 $("#return_top a").click(function() { 7 var myHref= $(this).attr("href"); 8 var myPos = $(myHref).offset().top; 9 $("html,body").animate({scrollTop : myPos}, 1000, "easeOutExpo"); 10 return false; 11 }); 12 13 //return top button 14 var topBtn = $("#return_top"); 15 $(window).scroll(function () { 16 var scrTop = $(this).scrollTop(); 17 if (scrTop > 100) { 18 topBtn.stop().fadeIn("slow"); 19 } else { 20 topBtn.stop().fadeOut(); 21 } 22 }); 23 24 // blog archive category hover 25 $("#post_list a span[data-href]").hover( 26 function() { 27 var $a = $(this).closest("a"); 28 $a.attr("data-href", $a.attr("href")); 29 if ($(this).attr("data-href")) { 30 $a.attr("href", $(this).attr("data-href")); 31 } 32 }, 33 function() { 34 var $a = $(this).closest("a"); 35 $a.attr("href", $a.attr("data-href")); 36 } 37 ); 38 39 //category widget 40 $(".collapse_category_list li").hover( 41 function(){ 42 $(">ul:not(:animated)",this).slideDown("fast"); 43 $(this).addClass("active"); 44 }, 45 function(){ 46 $(">ul",this).slideUp("fast"); 47 $(this).removeClass("active"); 48 } 49 ); 50 51 //comment tab 52 $("#trackback_switch").click(function(){ 53 $("#comment_switch").removeClass("comment_switch_active"); 54 $(this).addClass("comment_switch_active"); 55 $("#comment_area").animate({opacity: "hide"}, 0); 56 $("#trackback_area").animate({opacity: "show"}, 1000); 57 return false; 58 }); 59 60 $("#comment_switch").click(function(){ 61 $("#trackback_switch").removeClass("comment_switch_active"); 62 $(this).addClass("comment_switch_active"); 63 $("#trackback_area").animate({opacity: "hide"}, 0); 64 $("#comment_area").animate({opacity: "show"}, 1000); 65 return false; 66 }); 67 68 // mobile toggle global nav 69 $(".menu_button").on("click", function(){ 70 if($(this).hasClass("active")) { 71 $(this).removeClass("active"); 72 $("#header").removeClass("active"); 73 $("#global_menu").hide(); 74 return false; 75 } else { 76 $(this).addClass("active"); 77 $("#header").addClass("active"); 78 $("#global_menu").show(); 79 return false; 80 }; 81 }); 82 83 // mobile global nav toggle children 84 $("#global_menu li > ul").parent().prepend("<span class='child_menu_button'><span class='icon'></span></span>"); 85 $("#global_menu .child_menu_button").on("click", function() { 86 if($(this).parent().hasClass("open")) { 87 $(this).parent().removeClass("open"); 88 return false; 89 } else { 90 $(this).parent().addClass("open"); 91 return false; 92 }; 93 }); 94 95 // index content1 96 if ($("#index_content1 .caption").length) { 97 $(window).bind("resize orientationchange", function(){ 98 $("#index_content1 .caption").each(function(){ 99 var $caption = $(this); 100 var $headline = $(this).find(".headline"); 101 var $desc = $(this).find(".desc"); 102 $headline.removeAttr("style"); 103 $desc.removeAttr("style"); 104 105 var body_width = $("body").width(); 106 var headline_font_size = parseFloat($headline.css("fontSize")); 107 var desc_font_size = parseFloat($desc.css("fontSize")); 108 var desc_line_height = parseFloat($desc.css("lineHeight")); 109 if (body_width >= 768 && body_width < 1280) { 110 var rasio = $("#index_content1").width() / 1150; 111 $headline.css("fontSize", headline_font_size * rasio + "px") 112 desc_font_size = desc_font_size * rasio; 113 desc_line_height = desc_line_height * rasio; 114 $desc.css({ 115 fontSize: desc_font_size + "px", 116 lineHeight: desc_line_height + "px", 117 }); 118 } else if (body_width < 375) { 119 var rasio = $("#index_content1").width() / 331; 120 $headline.css("fontSize", headline_font_size * rasio + "px") 121 desc_font_size = desc_font_size * rasio; 122 desc_line_height = desc_line_height * rasio; 123 $desc.css({ 124 fontSize: desc_font_size + "px", 125 lineHeight: desc_line_height + "px", 126 }); 127 } 128
129 var remain_height = $caption.innerHeight() - $desc.position().top; 130 var desc_line_height_offset = 0; 131 if (desc_line_height > desc_font_size) { 132 desc_line_height_offset = (desc_line_height - desc_font_size) / 2; 133 } 134 if ($desc.height() > remain_height && desc_line_height > 0) { 135 for (var i=1; i<=100; i++) { 136 if (i*desc_line_height - desc_line_height_offset > remain_height) { 137 $desc.css({ 138 maxHeight: (i-1) * desc_line_height + "px", 139 overflow: "hidden", 140 }); 141 break; 142 } 143 } 144 } 145 }); 146 }); 147 } 148});
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.