1// JavaScript Document 2 3$(function() { 4 var topBtn = $('#page-top'); 5 topBtn.hide(); 6 $(window).scroll(function () { 7 if ($(this).scrollTop() > 500) { 8 topBtn.fadeIn(); 9 } else { 10 topBtn.fadeOut(); 11 } 12 }); 13 topBtn.click(function () { 14 $('body,html').animate({ 15 scrollTop: 0 16 }, 500); 17 return false; 18 }); 19}); 20 21 22(function($){ 23 $.fn.fontSize = function(options) { 24 25 var defaultState = "small" 26 var keyName = "state"; 27 28 var defaults = { "data" : [ 29 { 30 "target" : "body", 31 "size" : { "small":"12px", "medium":"14px", "large":"16px" } 32 } 33 ]}; 34 var setting = $.extend( defaults, options ); 35 36 var html = '<div id="j-font-size"><div id="j-font-size-small" class="small"><span>å°</span></div><div id="j-font-size-medium" class="medium"><span>æ¨æº</span></div><div id="j-font-size-large" class="large"><span>大</span></div></div>'; 37 var state; 38 var self = this; 39 40 $(self).append(html); 41 42 if(!(state = $.cookie(keyName))){ 43 state = defaultState; 44 } 45 46 $("#j-font-size-"+state).addClass("active"); 47 setFontSize(state); 48 49 50 $("#j-font-size>div").click(function(e){ 51 var state = $(this).attr("id").replace("j-font-size-",""); 52 53 setFontSize(state); 54 55 $("#j-font-size>div").removeClass("active"); 56 $(this).addClass("active"); 57 58 $.cookie(keyName,state,{expires : 365, path : '/'}); 59 60 }); 61 62 function setFontSize(state){ 63 var data = setting["data"]; 64 65 for(var i = 0; i < data.length; i++){ 66 var target = data[i]["target"]; 67 var size = data[i]["size"]; 68 69 $(target).css("font-size",size[state]); 70 71 } 72 } 73 } 74})(jQuery); 75 76
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.