PageSourceSearch

http://vapro.com/js/site.js

js vapro.com collected 2026-10-08 03:32:01 UTC 3,912 bytes, 146 lines download raw bytes

1var bannerTotal = 0;
2var bannerActive = 1;
3
4$(document).ready(function(){
5	$('a.page-scroll').bind('click', function(event) {
6		var $link = $(this);
7		$('html, body').stop().animate(
8			{ scrollTop: $($link.attr('href')).offset().top },
9			1400,
10			'easeInOutQuint'
11		);
12		event.preventDefault();
13	});
14	$(window).scroll(function() {
15		scrollWindow();
16	});
17	$(window).resize(function() {
18		resizeWindow();
19	});
20	$('.rotator-dot').on('click',function(){
21		dotClicked( $(this).attr('id').substr( 4, 5 ) );
22	});
23	$( '#rotator-prev' ).on( 'click', prevClicked );
24	$( '#rotator-next' ).on( 'click', nextClicked );
25	bannerTotal = $('.rotator-img').length;
26	// services
27	$('.section-services .nav a').on( 'click', function() {
28		$('.s-services').hide();
29		$( '.' + $(this).attr('tar') ).show();
30		$('.section-services .nav a').removeClass( 'active' );
31		$(this).addClass( 'active' );
32		return false;
33	} );
34	// videos
35	$('.section-videos .nav a').on( 'click', function() {
36		$('.s-videos').hide();
37		$( '.' + $(this).attr('tar') ).show();
38		$('.section-videos .nav a').removeClass( 'active' );
39		$(this).addClass( 'active' );
40		return false;
41	} );
42	//about
43	$('.section-about .nav a').on( 'click', function() {
44		$('.s-about').hide();
45		$( '.' + $(this).attr('tar') ).show();
46		$('.section-about .nav a').removeClass( 'active' );
47		$(this).addClass( 'active' );
48		return false;
49	} );
50	// init
51	scrollWindow( true );
52	$(".fancybox").fancybox({
53		helpers: {
54			overlay: {
55				locked: false
56			}
57		}
58	});
59	setBannerTimer();
60	resizeWindow();
61});
62
63function scrollWindow( instant ) {
64	if ( instant ) {
65		$(".navbar").removeClass( 'navbar-animate' );
66	}
67	if ($(".navbar").offset().top > 50) {
68		$(".navbar-fixed-top").addClass("top-nav-collapse");
69	} else {
70		$(".navbar-fixed-top").removeClass("top-nav-collapse");
71	}
72	$(".navbar").addClass( 'navbar-animate' );
73}
74
75function resizeWindow() {
76	centerBannerH1s();
77}
78function centerBannerH1s() {
79	$('.section-intro .rheader-container').each(function(){
80		$($(this).find('h1')).css( { paddingTop: '0px' } );
81		var h1Offset = ( $(this).outerHeight() - $($(this).find('h1')).outerHeight() ) / 2;
82		console.log( 'offset: ' + h1Offset );
83		$($(this).find('h1')).css( { paddingTop: h1Offset + 'px' } );
84	});
85}
86
87var bannerTimer;
88var btDur;
89var btShort = 10000;
90var btLong = 60000;
91// var btShort = 10000000;
92// var btLong = 60000000;
93function setBannerTimer( dur ) {
94	if ( bannerTimer ) clearTimeout( bannerTimer );
95	if ( dur == undefined ) dur = btShort;
96	btDur = dur;
97	bannerTimer = setTimeout( onBannerTimer, dur );
98}
99
100function onBannerTimer() {
101	nextBanner();
102	setBannerTimer();
103}
104
105function prevClicked() {
106	setBannerTimer( btLong );
107	prevBanner();
108}
109
110function nextClicked() {
111	setBannerTimer( btLong );
112	nextBanner();
113}
114
115function dotClicked( n ) {
116	setBannerTimer( btLong );
117	setActiveBanner( n, 1 );
118}
119
120function nextBanner() {
121	setActiveBanner( bannerActive+1, 1 );
122}
123
124function prevBanner() {
125	setActiveBanner( bannerActive-1, -1 );
126}
127
128function setActiveBanner( id, dir ){
129	var offset = dir ? ( dir * 40 ) : 0;
130	if ( id > bannerTotal ) id = 1;
131	if ( id < 1 ) id = bannerTotal;
132	$('#rotator'+bannerActive).stop(true).animate( { opacity: 0 }, 300, 'easeInQuad' );
133	$('#rh1_'+bannerActive).stop(true).animate( { opacity: 0 }, 300, 'easeInQuad', function(){ $(this).hide(); } );
134	// handle backgrounds
135	$('.rotator-img').not('#rotator'+bannerActive).css( { opacity: 0 } );
136	$('#rotator'+id).stop(true).delay(300).css( { opacity: 0 } ).animate( { opacity: 1 }, 300, 'easeOutQuad' );
137	// handle header text
138	$('.rheader-container').not('#rh1_'+bannerActive).css( { display: 'none' } );
139	$('#rh1_'+id).stop(true).delay(300).css( { opacity: 0 } ).show().animate( { opacity: 1, left: 0 }, 300, 'easeOutQuad' );
140	// handle dots
141	$('.rotator-dot').removeClass('active');
142	$('#rdot'+id).addClass('active');
143	bannerActive = id;
144	console.log( $('#rh1_'+id).outerHeight() );
145	centerBannerH1s();
146}

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.