1$(document).ready(function () { 2 $(window).scroll(function () { 3 if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px 4 $('#return-to-top').fadeIn(200); // Fade in the arrow 5 } else { 6 $('#return-to-top').fadeOut(200); // Else fade out the arrow 7 } 8 }); 9 10 $('#return-to-top').click(function () { // When arrow is clicked 11 $('body,html').animate({ 12 scrollTop: 0 // Scroll to top of body 13 }, 500); 14 }); 15}); 16// ===== Scroll to Top ==== 17 18/** 19 * jQuery.share - social media sharing plugin 20 * --- 21 * @author Carol Skelly (http://in1.com) 22 * @version 1.0 23 * @license MIT license (http://opensource.org/licenses/mit-license.php) 24 * --- 25 */ 26 27;(function ( $, window, undefined ) { 28 29 var document = window.document; 30 31 $.fn.share = function(method) { 32 33 var methods = { 34 35 init : function(options) { 36 this.share.settings = $.extend({}, this.share.defaults, options); 37 var settings = this.share.settings, 38 networks = this.share.settings.networks, 39 theme = this.share.settings.theme, 40 orientation = this.share.settings.orientation, 41 affix = this.share.settings.affix, 42 margin = this.share.settings.margin, 43 pageTitle = this.share.settings.title||$(document).attr('title'), 44 pageUrl = this.share.settings.urlToShare||$(location).attr('href'), 45 pageDesc = ""; 46 47 $.each($(document).find('meta[name="description"]'),function(idx,item){ 48 pageDesc = $(item).attr("content"); 49 }); 50 51 // each instance of this plugin 52 return this.each(function() { 53 var $element = $(this), 54 id=$element.attr("id"), 55 u=encodeURIComponent(pageUrl), 56 t=encodeURIComponent(pageTitle), 57 d=pageDesc.substring(0,250), 58 href; 59 60 // append HTML for each network button 61 for (var item in networks) { 62 item = networks[item]; 63 href = helpers.networkDefs[item].url; 64 href = href.replace('|u|',u).replace('|t|',t).replace('|d|',d) 65 .replace('|140|',t.substring(0,130)); 66 $("<a href='"+href+"' title='Share this page on "+item+ 67 "' class='pop share-"+theme+" share-"+theme+"-"+item+"'></a>") 68 .appendTo($element); 69 } 70 71 // customize css 72 $("#"+id+".share-"+theme).css('margin',margin); 73 74 if (orientation != "horizontal"){ 75 $("#"+id+" a.share-"+theme).css('display','block'); 76 } 77 else { 78 $("#"+id+" a.share-"+theme).css('display','inline-block'); 79 } 80 81 if (typeof affix != "undefined"){ 82 $element.addClass('share-affix'); 83 if (affix.indexOf('right')!=-1){ 84 $element.css('left','auto'); 85 $element.css('right','0px'); 86 if (affix.indexOf('center')!=-1){ 87 $element.css('top','40%'); 88 } 89 } 90 else if (affix.indexOf('left center')!=-1){ 91 $element.css('top','40%'); 92 } 93 94 if (affix.indexOf('bottom')!=-1){ 95 $element.css('bottom','0px'); 96 $element.css('top','auto'); 97 if (affix.indexOf('center')!=-1){ 98 $element.css('left','40%'); 99 } 100 } 101 } 102 103 // bind click 104 $('.pop').click(function(){ 105 window.open($(this).attr('href'),'t','toolbar=0,resizable=1,status=0,width=640,height=528'); 106 return false; 107 }); 108 109 110 });// end plugin instance 111 112 } 113 } 114 115 var helpers = { 116 networkDefs: { 117 facebook:{url:'http://www.facebook.com/share.php?u=|u|'}, 118 //http://twitter.com/home?status=jQuery%20Share%20Social%20Media%20Plugin%20-%20Share%20to%20multiple%20social%20networks%20from%20a%20single%2
1180form%20http://plugins.in1.com/share/demo 119 twitter:{url:'https://twitter.com/share?url=|u|&text=|140|'}, 120 linkedin:{url:'http://www.linkedin.com/shareArticle?mini=true&url=|u|&title=|t|&summary=|d|&source=in1.com'}, 121 in1:{url:'http://www.in1.com/cast?u=|u|',w:'490',h:'529'}, 122 tumblr:{url:'http://www.tumblr.com/share?v=3&u=|u|'}, 123 digg:{url:'http://digg.com/submit?url=|u|&title=|t|'}, 124 googleplus:{url:'https://plusone.google.com/_/+1/confirm?hl=en&url=|u|'}, 125 reddit:{url:'http://reddit.com/submit?url=|u|'}, 126 pinterest:{url:'http://pinterest.com/pin/create/button/?url=|u|&media=&description=|d|'}, 127 posterous:{url:'http://posterous.com/share?linkto=|u|&title=|t|'}, 128 stumbleupon:{url:'http://www.stumbleupon.com/submit?url=|u|&title=|t|'}, 129 email:{url:'mailto:?subject=|t|'} 130 } 131 } 132 133 if (methods[method]) { 134 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 135 } else if (typeof method === 'object' || !method) { 136 return methods.init.apply(this, arguments); 137 } else { 138 $.error( 'Method "' + method + '" does not exist in social plugin'); 139 } 140 141 } 142 143 $.fn.share.defaults = { 144 networks: ['facebook','twitter','linkedin'], 145 theme: 'icon', // use round icons sprite 146 autoShow: true, 147 margin: '3px', 148 orientation: 'horizontal', 149 useIn1: false 150 } 151 152 $.fn.share.settings = {} 153 154})(jQuery, window); 155 156$(document).ready(function() { 157 $('#divShare').share({ 158 networks: ['facebook', 'twitter', 'email'] 159 //urlToShare: 'http://www.sandiegohills.co.id/support/images/logosdh.png' 160 }); 161});
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.