1'use strict'; 2var $ = window.jQuery; 3 4/*jquery-scrollstop*/ 5!function(factory){"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)}(function($){var dispatch=$.event.dispatch||$.event.handle,special=$.event.special,uid1="D"+ +new Date,uid2="D"+(+new Date+1);special.scrollstart={setup:function(data){var timer,_data=$.extend({latency:special.scrollstop.latency},data),handler=function(evt){var _self=this,_args=arguments;timer?clearTimeout(timer):(evt.type="scrollstart",dispatch.apply(_self,_args)),timer=setTimeout(function(){timer=null},_data.latency)};$(this).bind("scroll",handler).data(uid1,handler)},teardown:function(){$(this).unbind("scroll",$(this).data(uid1))}},special.scrollstop={latency:250,setup:function(data){var timer,_data=$.extend({latency:special.scrollstop.latency},data),handler=function(evt){var _self=this,_args=arguments;timer&&clearTimeout(timer),timer=setTimeout(function(){timer=null,evt.type="scrollstop",dispatch.apply(_self,_args)},_data.latency)};$(this).bind("scroll",handler).data(uid2,handler)},teardown:function(){$(this).unbind("scroll",$(this).data(uid2))}}}); 6 7 8/* one-page scrolling 9------------------------------------------------------------------------*/ 10 11$(document).ready(function(){ 12 13 /* Initialize Match Height plugin */ 14 $('.recent-entry-title').matchHeight(); 15 $('.recent-entry-content').matchHeight(); 16 $('.content-icon .title').matchHeight(); 17 $('.content-icon .body').matchHeight(); 18 19 $(window).scroll(function() { 20 var header_height = $('.header').height()+$('.header-toggle').height(); 21 var scroll = $(window).scrollTop(); 22 var navbar = $(".navbar-custom"); 23 if(header_height > 0) { 24 if (scroll >= header_height) { 25 navbar.addClass("navbar-fixed-top fixed-top"); 26 } else { 27 navbar.removeClass("navbar-fixed-top fixed-top"); 28 } 29 } 30 }); 31 32 $(window).resize(function(){ 33 resize_nav_wrapper(); 34 }); 35 resize_nav_wrapper(); 36 37 $('.menu-header .page-scroll a').click(function(){ 38 jQuery('.menu-header .page-scroll>a').removeClass('showing'); 39 jQuery(this).addClass('showing'); 40 var href = jQuery(this).attr('href').split('#'); 41 if(jQuery('.navbar-custom .navbar-toggle').css('display')!='none'){ 42 jQuery('.navbar-custom .navbar-toggle').click(); 43 } 44 var Header_height = jQuery('.nav-wrapper').innerHeight(); 45 46 if(href[1]){ 47 if(jQuery('#'+href[1]).length>0){ 48 var posEle =jQuery('#'+href[1]).offset().top - Header_height; 49 jQuery('html,body').animate({scrollTop:posEle},600); 50 return false; 51 } 52 } 53 }); 54 $(window).load(function(){ 55 var hash = window.location.hash; 56 var Header_height = jQuery('.navbar-custom').innerHeight(); 57 if(hash){ 58 if(jQuery(hash).length>0){ 59 var posEle =jQuery(hash).offset().top - Header_height; 60 jQuery('html,body').animate({scrollTop:posEle},600); 61 return false; 62 } 63 } 64 }); 65 $('.navbar-custom').append('<div id="xxxx" style="position:absolute;right:0;top:0"></div>'); 66 $(window).scroll(function(){ 67 $('.section').each(function(){ 68 //var visible = jQuery(this).visible('false'); 69 var visible = isScrolledIntoView(jQuery(this)); 70 if(visible){ 71 var id = jQuery(this).attr('id'); 72 if (jQuery(".menu-header .page-scroll > a[href*='"+id+"']").length>0) { 73 jQuery('.menu-header .page-scroll > a').removeClass('showing'); 74 jQuery(".menu-header .page-scroll > a[href*='"+id+"']").addClass('showing'); 75 } 76 } 77 }); 78 }); 79 $(".header-toggle").click(function(){ 80 $(this).toggleClass('open'); 81 $('.header').toggleClass('open'); 82 return false; 83 }); 84 $(window).scroll(); 85}); 86 87function isScrolledIntoView(elem) 88{ 89 var $elem = jQuery(elem); 90 var $window = jQuery(window); 91 var $navbar = jQuery(".navbar-custom"); 92 93 var docViewTop = $window.scrollTop(); 94 var docViewBottom = docViewTop + $window.height(); 95
96 var elemTop = $elem.offset().top-$navbar.innerHeight()-20; 97 var elemBottom = elemTop + $elem.height(); 98 return ((docViewTop >= elemTop)); 99} 100 101function resize_nav_wrapper(){ 102 //var header_height = jQuery('.header').height(); 103 var navbar_custom_height = jQuery('.navbar-custom').height(); 104 //if(header_height > 0 && jQuery( window ).width() >= 768) { 105 //console.log('navbar_custom_height=' + navbar_custom_height); 106 jQuery('.nav-wrapper').height(navbar_custom_height); 107 //} else jQuery('.body_padding').css("padding-top", navbar_custom_height); 108} 109 110/* back to top, window resizing 111------------------------------------------------------------------------*/ 112 113$(document).ready(function() { 114 115 //back to top 116 $(window).scroll(function(){ 117 if($(window).scrollTop()>100){ 118 if(!$('#back_to_top').hasClass('show')) 119 $('#back_to_top').addClass('show'); 120 if(!$('#back_to_top').hasClass('scroll')) 121 $('#back_to_top').addClass('scroll'); 122 } 123 else 124 $('#back_to_top').removeClass('show'); 125 }); 126 $(window).on('scrollstop',function(){ 127 $('#back_to_top').removeClass('scroll'); 128 }); 129 if($(window).scrollTop()>100) $('#back_to_top').addClass('show'); 130 else $('#back_to_top').removeClass('show'); 131 $('#back_to_top').click(function(){ 132 $('html,body').stop().animate({scrollTop:0},1000); 133 return false; 134 }); 135 136 137 //window resizing, full screen banners 138 $(window).resize(function(){ 139 EventOnResize(); 140 }); 141 EventOnResize(); 142 143 144}); 145 146/* resizing elements 147------------------------------------------------------------------------*/ 148 149function EventOnResize(){ 150 var $wHieght = $(window).height(); 151 var $nhHieght = $('.navbar-custom').height(); 152 var $nnH = $wHieght-$nhHieght; 153 $('.image-banner.full-screen').css('height',$nnH+'px'); 154 155}
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.