PageSourceSearch

https://www.pucminas.br/Style%20Library/STATIC/js/fullscreen.js

js pucminas.br collected 2026-09-24 08:29:26 UTC 3,629 bytes, 146 lines download raw bytes

1/**
2 *	FullScreen theme
3 *	Autor: Gustavo Perenciolo
4 *	2016
5**/
6$(document).ready(function() {
7    //pegar margem do elemento
8	var navHeight = $('body > .navbar').outerHeight(true);
9	
10	$('body > .navbar').on("click", 'a.off' , function(e){
11		e.preventDefault();
12		
13		var target = $(this).attr("href");
14		var elementOffSet = $(target).offset().top;
15		var distance = (elementOffSet - navHeight);
16		$('html, body').stop(true, true).animate({
17			scrollTop: distance
18		}, '500', 'swing', function(){
19			$('body > .navbar .active').removeClass('active');
20			$('a[href="'+ target +'"]').parent().addClass('active');
21		});
22	});
23});
24
25/**
26================================
27	Redirecionamento Brasão
28================================
29*/
30$(document).ready(function() {
31    $('.pucminas').click(function(){
32		var url = $(this).attr('href');
33		window.open(url);
34	});
35});
36
37/**
38================================
39	Scroll Top Animation
40================================
41*/
42//esconde por padrão
43$('#subir').hide();
44
45//caso haja o scroll ele aparece
46$(window).scroll(function(){
47	if ($(window).scrollTop() > 250){
48		$('#subir').fadeIn(100);
49	}else{
50		$('#subir').fadeOut(100);
51	}
52});
53
54//Animação do Scroll
55$(document).ready(function(){
56	$(".scroll").click(function(e){
57		e.preventDefault();
58		$('html,body').animate({scrollTop: $(this.hash).offset().top}, 1000);
59	});
60});
61
62
63/**
64================================
65	       banner
66================================
67*/
68$(document).ready(function() {
69
70	//rotation speed and timer
71	var speed = 5000;
72	var run = setInterval('rotate()', speed);	
73	
74	//grab the width and calculate left value
75	var item_width = $('#slides li').outerWidth(); 
76	var left_value = item_width * (-1); 
77        
78    //move the last item before first item, just in case user click prev button
79	$('#slides li:first').before($('#slides li:last'));
80	
81	//set the default item to the correct position 
82	$('#slides ul').css({'left' : left_value});
83
84    //if user clicked on prev button
85	$('#prev').click(function() {
86
87		//get the right position            
88		var left_indent = parseInt($('#slides ul').css('left')) + item_width;
89
90		//slide the item            
91		$('#slides ul').animate({'left' : left_indent}, 200,function(){    
92
93            //move the last item and put it as first item            	
94			$('#slides li:first').before($('#slides li:last'));           
95
96			//set the default item to correct position
97			$('#slides ul').css({'left' : left_value});
98		
99		});
100
101		//cancel the link behavior            
102		return false;
103            
104	});
105
106 
107    //if user clicked on next button
108	$('#next').click(function() {
109		
110		//get the right position
111		var left_indent = parseInt($('#slides ul').css('left')) - item_width;
112		
113		//slide the item
114		$('#slides ul').animate({'left' : left_indent}, 200, function () {
115            
116            //move the first item and put it as last item
117			$('#slides li:last').after($('#slides li:first'));                 	
118			
119			//set the default item to correct position
120			$('#slides ul').css({'left' : left_value});
121		
122		});
123		         
124		//cancel the link behavior
125		return false;
126		
127	});        
128	
129	//if mouse hover, pause the auto rotation, otherwise rotate it
130	$('#slides').hover(
131		
132		function() {
133			clearInterval(run);
134		}, 
135		function() {
136			run = setInterval('rotate()', speed);	
137		}
138	); 
139        
140});
141
142//a simple function to click next link
143//a timer will call this function, and the rotation will begin :)  
144function rotate() {
145	$('#next').click();
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.