1jQuery(document).ready(function(){ 2/*global jQuery:false */ 3/*jshint devel:true, laxcomma:true, smarttabs:true */ 4"use strict"; 5 6 // hide .scrollTo_top first 7 jQuery(".scrollTo_top").hide(); 8 // fade in .scrollTo_top 9 jQuery(function () { 10 jQuery(window).scroll(function () { 11 if (jQuery(this).scrollTop() > 100) { 12 jQuery('.scrollTo_top').fadeIn(); 13 } else { 14 jQuery('.scrollTo_top').fadeOut(); 15 } 16 }); 17 18 // scroll body to 0px on click 19 jQuery('.scrollTo_top a').click(function(){ 20 jQuery('html, body').animate({scrollTop:0}, 500 ); 21 return false; 22 }); 23 }); 24 25 /* ticker */ 26 27 jQuery(function(){jQuery("ul.ticker").liScroll();}); 28 29 30 31 /* default hovers */ 32 33 jQuery('.seccol,.widgetflexslider li,.widgetcol_big,.widgetcol_small,.tab-post,.fblock').hover(function() { 34 jQuery(this).find('img') 35 .animate({opacity:'0.8'}, 300); 36 37 } , function() { 38 39 jQuery(this).find('img') 40 .animate({opacity:'1'}, 400); 41 }); 42 43 jQuery('.gallery-item img,li.format-image img').hover(function() { 44 jQuery(this).animate({opacity: 0.1}, "normal"); 45 }, function() { 46 jQuery(this).animate({opacity: 1}, "normal"); 47 }); 48 49 50 51 52 53 /* sticky navigation */ 54 55 jQuery(function() { 56 57 // grab the initial top offset of the navigation 58 var sticky_navigation_offset_top = jQuery('#navigation').offset().top; 59 60 // our function that decides weather the navigation bar should have "fixed" css position or not. 61 var sticky_navigation = function(){ 62 var scroll_top = jQuery(window).scrollTop(); // our current vertical position from the top 63 64 // if we've scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative 65 if (scroll_top > sticky_navigation_offset_top) { 66 jQuery('#navigation').css({ 'position': 'fixed', 'top':0, 'width':1078, 'z-index':99 }); 67 jQuery('#navigation').addClass('disres'); 68 } else { 69 jQuery('#navigation').css({ 'position': 'relative' ,'width':'100%', 'top':0}); 70 jQuery('#navigation').removeClass('disres'); 71 } 72 }; 73 74 // run our function on load 75 sticky_navigation(); 76 77 // and run it again every time you scroll 78 jQuery(window).scroll(function() { 79 sticky_navigation(); 80 }); 81 82 // NOT required: 83 // for this demo disable all links that point to "#" 84 jQuery('a[href="#"]').click(function(event){ 85 event.preventDefault(); 86 }); 87 88 }); 89 90 91 /* Tooltips */ 92 jQuery("body").prepend('<div class="tooltip"><p></p></div>'); 93 var tt = jQuery("div.tooltip"); 94 95 jQuery(".flickr_badge_image a img,ul.social-menu li a,.rating img,.post-ratings img").hover(function() { 96 var btn = jQuery(this); 97 98 tt.children("p").text(btn.attr("title")); 99 100 var t = Math.floor(tt.outerWidth(true)/2), 101 b = Math.floor(btn.outerWidth(true)/2), 102 y = btn.offset().top - 35, 103 x = btn.offset().left - (t-b); 104 105 tt.css({"top" : y+"px", "left" : x+"px", "display" : "block"}); 106 107 }, function() { 108 tt.hide(); 109 }); 110 111 112 function lightbox() { 113 // Apply PrettyPhoto to find the relation with our portfolio item 114 jQuery("a[rel^='prettyPhoto']").prettyPhoto({ 115 // Parameters for PrettyPhoto styling 116 animationSpeed:'fast', 117 slideshow:5000, 118 theme:'pp_default', 119 show_title:false, 120 overlay_gallery: false, 121 social_tools: false 122 }); 123 } 124 125 if(jQuery().prettyPhoto) { 126 lightbox(); 127 } 128 129});
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.