PageSourceSearch

https://unidadeditorial.es/js/funciones.js

js unidadeditorial.es collected 2026-10-02 03:46:24 UTC 15,959 bytes, 640 lines download raw bytes

1
2
3var hah = false;
4var eslapriemara = 20;
5var quitapone;
6var hideTwitterAttempts = 0;
7var isiPad = navigator.userAgent.match(/iPad/i) != null;
8var isiPhone = navigator.userAgent.match(/iPhone/i) != null;
9var video = document.getElementById("corpor");
10
11$(document).ready(inicia);
12function inicia(){
13		
14		
15	    $('#menu').click(menulateral);
16		contaimaginislider();			   						   
17		slider(); 
18		slidergrupo();
19		sliderTitulo();  
20		
21		font();
22		$('section#inicio button').click(abrelogos);
23		hideTwitterBoxElements();
24		ipadvideonone();
25		fichaconvideo();
26		 
27		
28}
29
30
31function fichaconvideo(){
32	
33	$("#ficha h2:contains('ORBYT') + article").attr("id","fichaconvideo");
34	$("#ficha h2:contains('CLUB') + article").attr("id",'fichaconvideo');
35	
36	}
37
38
39function font(){
40
41$('section#inicio h1 ').flowtype({
42 minimum   : 200,
43 maximum   : 1100,
44 minFont   : 36,
45 maxFont   : 74,
46 fontRatio : 15
47}); 
48$('section#inicio h2 ').flowtype({
49 minimum   : 200,
50 maximum   : 1000,
51 minFont   : 12,
52 maxFont   : 19,
53 fontRatio : 30
54}); 
55$('section#info h4 ').flowtype({
56 minimum   : 200,
57 maximum   : 1000,
58 minFont   : 40,
59 maxFont   : 70,
60 fontRatio : 8
61}); 
62$('section#info h2 ').flowtype({
63 minimum   : 200,
64 maximum   : 1000,
65 minFont   : 14,
66 maxFont   : 24,
67 fontRatio : 20
68}); 
69
70}
71
72
73
74
75function arrancavideo() {
76	 var video = document.getElementById("corpor");
77		
78			
79			if($('.bloque #corpor').offset().top - $(window).scrollTop() < 165){vidplay();video.muted = false;}
80			if($('.bloque #corpor').offset().top - $(window).scrollTop() < -430){video.muted = true}
81	 		//if ($('.bloque #corpor').offset().top- $(window).scrollTop()   < 100 ){video.pause();}
82	 
83
84	 
85}
86
87//$('section#noticiasinterna section#twit.fijotwit').css({'marginTop':'0','width':(100 + '%'), 'left':'none'})
88
89function fijotwit() {
90	
91	if($('section#noticiasinterna #noticias').height() > ($('section#noticiasinterna #otrasnoticias').height()  ) ){
92	
93	var anchopadding = ($('section#noticiasinterna').width()* 0.04).toPrecision(1);
94	
95//Engancha
96	
97// if($('section#noticiasinterna section#twit').offset().top - $(window).scrollTop() < 1){$('section#noticiasinterna section#twit').removeClass('enganchaabajo'); $('section#noticiasinterna section#twit').removeClass('fijotwit');$('section#noticiasinterna section#twit').removeAttr( "style" )}
98	
99//if($('section#noticiasinterna #noticias').offset().top - $(window).scrollTop() + $(window).height() < - 1){$('section#noticiasinterna section#twit').addClass('fijotwit'); $('section#noticiasinterna section#twit').removeClass('enganchaabajo');$('section#noticiasinterna section#twit.fijotwit').css({'marginTop':'0','width':($('#otrasnoticias').width()-5),'left':(($(document).width() - $('section#inicio + .bloque').width())/2 + $('section#noticiasinterna #noticias').width() + anchopadding.toPrecision(1) ) })}
100	
101//ABAJO
102	
103	// if($('body > footer').offset().top - $(window).scrollTop() -  $(window).height() < -1  ){$('section#noticiasinterna section#twit').addClass('enganchaabajo'); $('section#noticiasinterna section#twit.enganchaabajo').css({marginTop:(( $('section#noticiasinterna #noticias').height() - $('#otrasnoticias').height() + $('section#noticiasinterna section#twit').height()))+'px', 'left':( 10 + '%')} )}	
104	
105	}
106
107}
108
109
110
111
112
113$(window).scroll(function() {
114	var video = document.getElementById("corpor");
115	if (video != null){
116	
117	arrancavideo();}
118		fijotwit();
119   
120});
121
122
123
124
125
126
127
128
129function vidplay() {
130       var video = document.getElementById("corpor");
131   
132       if (  eslapriemara > 1) {
133          video.play();
134		  
135		  eslapriemara=0;
136         
137       } 
138    }
139
140
141function abrelogos(){
142	
143	$('#logos').toggleClass('abierto');
144	$(this).toggleClass('abierto');
145	
146	}
147
148
149
150function hideTwitterBoxElements() {
151    setTimeout( function() {
152        if ( $('[id*=twitter]').length ) {
153        $('[id*=twitter]').each( function(){
154            var ibody = $(this).contents().find( 'body' );
155
156            if ( ibody.find( '.timeline .stream .h-feed li.tweet' ).length ) {
157            ibody.find( '.timeline' ).css( 'color', '#767676' ); //theme: shell: background:
158			ibody.find( '.var-chromeless .permalink' ).css('padding','0 20px 0 0px');
159			ibody.width( $(this).width() + 20 );
160			ibody.find( '.custom-timeline-owner-profile, .timeline .e-entry-title, .p-author .p-name, .cards-base h3, .new-tweets-bar button, .load-tweets, .no-more-pane').css('line-height','22px');
161			ibody.find( '.custom-timeline-owner-profile, .timeline .e-entry-title, .p-author .p-name, .cards-base h3, .new-tweets-bar button, .load-tweets, .no-more-pane').css('font-size','12px');
162			  ibody.find( '.tweet-actions' ).css('right','18px');
163			  ibody.find( '.var-chromeless button.load-more' ).css( 'border', 0 );
164			  ibody.find( '.var-chromeless button.load-more' ).css( 'border-radius', '0px 0px 0px 0px' );
165			  ibody.find( '.var-chromeless button.load-more' ).css("box-shadow", "none");
166			   ibody.find( '.autosized-media' ).css("max-width", "100%");
167			   ibody.find( '.stream' ).css("max-width", "100%");
168			  ibody.find( 'html, .p-author .profile .p-name, .custom-timeline-owner-profile .p-name, .cards-base p, .cards-base p a, .timeline-header .custom-timeline-summary, .timeline-header .custom-timeline-summary a:link, .timeline-header .custom-timeline-summary a:visited, .timeline-header .summary, .timeline-header .summary a:link, .timeline-header .summary a:visited, .p-author a.profile:hover .p-name, .p-author a.profile:focus .p-name' ).css( 'color', '#767676' );
169            }
170            else {
171                $(this).hide();
172            }
173        });
174        }
175        hideTwitterAttempts++;
176        if ( hideTwitterAttempts < 3 ) {
177            hideTwitterBoxElements();
178        }
179    }, 1000);
180}
181
182
183
184
185
186$(window).resize(function() {
187hideTwitterBoxElements();
188slider(); 
189sliderTitulo(); 
190slidergrupo(); 
191var noticiasinterna = document.getElementById("noticiasinterna");
192	if (noticiasinterna != null){
193//fijotwit()
194}
195
196
197
198});	
199
200
201function contaimaginislider(){
202
203$('#slider li.item').each(function () {
204$('#slider .slideSelectors').prepend('<li class="pallina"></li>');
205
206});
207$('#slidergrupo li.item').each(function () {
208$('#slidergrupo .slideSelectors').prepend('<li class="pallina"></li>');
209});
210
211$('#inicio li.item').each(function () {
212$('#inicio .slideSelectors').prepend('<li class="pallina"></li>');
213});
214
215
216$('.pallina:first-child').addClass('selected');
217}
218
219
220
221
222function slider() {
223	
224	$('#slider .iosSlider').iosSlider({
225		desktopClickDrag: true,
226		snapToChildren: true,
227		navSlideSelector: '#slider .slideSelectors .pallina',
228		onSlideChange: slideChange,
229		scrollbar: false,
230		autoSlide: true,
231		autoSlideTimer: 6000,
232		keyboardControls:true,
233    infiniteSlider: true
234	});
235	
236	
237}
238
239function slidergrupo() { 	
240
241	
242$('#slidergrupo .iosSlider').iosSlider({
243	
244		
245			
246
247		desktopClickDrag: true,
248		snapToChildren: true,
249		navSlideSelector: '#slidergrupo .slideSelectors .pallina',
250		onSlideChange: slideChange2,
251		scrollbar: false,
252		autoSlide: true,
253		autoSlideTimer: 8000,
254		keyboardControls:true,
255	infiniteSlider: true,
256	onSlideComplete: slideContentComplete,
257    onSliderLoaded: slideContentLoaded
258	});
259	//$('#slidergrupo .iosSlider').css({'width':($('body > footer').width()-30),'max-width':'1100px'}) 
260	//$('#slidergrupo ').css({'width':($('body > footer').width()-18),'max-width':'1100px','overflow':'hidden'}) 
261	//$('#slidergrupo .iosSlider .item').css({'width':($('body > footer').width()),'max-width':'1100px'}) 
262}
263
264
265function sliderTitulo() {
266	
267	$('#inicio .iosSlider').iosSlider({
268		desktopClickDrag: true,
269		snapToChildren: true,
270		navSlideSelector: '#inicio .slideSelectors .pallina',
271		onSlideChange: slideChange3,
272		scrollbar: false,
273		autoSlide: true,
274		autoSlideTimer: 4000,
275		keyboardControls:true,
276    infiniteSlider: true
277	});
278	//$('#inicio .iosSlider').css({'width':($('body > footer').width())}) 
279	//$('#inicio ').css({'width':($('body > footer').width()),}) 
280	//$('#inicio .iosSlider .item').css({'width':($('body > footer').width())}) 
281	
282}
283
284function slideChange(args) {
285			
286	$('#slider .slideSelectors .pallina').removeClass('selected');
287	$('#slider .slideSelectors .pallina:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
288
289}
290
291function slideChange2(args) {
292						
293		$('#slidergrupo .slideSelectors .pallina').removeClass('selected');
294		$('#slidergrupo .slideSelectors .pallina:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
295				
296			
297			}	
298function slideChange3(args) {
299						
300		$('#inicio .slideSelectors .pallina').removeClass('selected');
301		$('#inicio .slideSelectors .pallina:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
302				
303}
304
305
306
307function slideContentComplete(args) {
308					
309					if(!args.slideChanged) return false;
310					
311					/* animation */
312					$(args.sliderObject).find(' h2,  p , a').attr('style', '');
313					
314					$(args.currentSlideObject).children('.item article').children('div').children('h2').animate({
315						marginLeft: '0px',
316						opacity: '1'
317					}, 800, 'easeOutQuint');
318					
319					$(args.currentSlideObject).children('.item article').children('div').children('p').delay(400).animate({
320						marginLeft: '0px',
321						opacity: '1'
322					}, 800, 'easeOutQuint');
323					
324					$(args.currentSlideObject).children('.item article').children('div').children('a').delay(400).animate({
325						marginLeft: '0px',
326						opacity: '1'
327					}, 800, 'easeOutQuint');
328					
329				}
330				
331				function slideContentLoaded(args) {
332					
333					/* animation */
334					$(args.sliderObject).children('.item article').children('div').find(' h2,   p, a').attr('style', '');
335					
336					$(args.currentSlideObject).children('.item article').children('div').children('h2').animate({
337						marginLeft: '0px',
338						opacity: '1'
339					}, 800, 'easeOutQuint');
340					
341					$(args.currentSlideObject).children('.item article').children('div').children('p').delay(400).animate({
342						marginLeft: '0px',
343						opacity: '1'
344					}, 800, 'easeOutQuint');
345					
346					(args.currentSlideObject).children('.item article').children('div').children('a').delay(800).animate({
347						marginLeft: '0px',
348						opacity: '1'
349					}, 800, 'easeOutQuint');
350					
351				}
352
353	
354function ipadvideonone() {
355	
356	if(isiPad == true || isiPhone == true){
357	
358		
359		$(' .mobile-video-image').css('display','block');
360		$(' .mobile-video-image + video').css('display','none');
361		}
362	
363	}
364	
365function menulateral(){
366	
367	$('#navlateral').toggleClass('active');
368slider(); 
369slidergrupo(); 
370		
371		
372		if($('#navlateral').css("right") == '-130px'   ){
373		
374	$('#navlateral').stop().animate({right:'0px'},200);
375	$('body').stop().animate({marginLeft:'-130px'},200);
376	
377		}else{
378			$('#navlateral').stop().animate({right:'-130px'},200);
379	$('body').stop().animate({marginLeft:'0px'},200);
380			
381			}
382			return false;
383	}
384
385
386
387
388	
389/*
390
391
392
393function entrada(){
394
395	$('#herramientas nav ul li:nth-child(1)').hide();
396	$('#herramientas nav ul li:nth-child(1)').hide();
397	$('#herramientas').animate({height:'400px'});
398	
399	$('#clasica .slider li').each(function() {
400	$('.selectors').append('<div class = "item"></div>');
401	$('.selectors .item:first-child').addClass('first selected')
402	
403	});	
404
405$('#favoritos .slider li').each(function() {
406	$('.selectors2').append('<div class = "item"></div>');
407	$('.selectors2 .item:first-child').addClass('first selected')
408	
409	});	
410	
411	
412	}
413
414
415function desplegaH() {
416		
417			
418		
419			$('#cortinilla').toggleClass('abierto');
420			if ($('#herramientas').height() > 300){
421				
422				$('#herramientas').animate({height:'75px'});
423				$('#herramientas .center').fadeOut();
424				
425				
426			}
427			else{
428				
429				if( hah == false){
430				$('#herramientas').animate({height:'400px'})}
431				else{ 
432				if( hah == true){
433				$('#herramientas').animate({height:'600px'})}
434				}
435					
436				$('#herramientas .center').fadeIn();
437				
438				}
439			
440				
441			return false;
442				
443}
444
445
446
447function desplega() {
448	
449			$(this).next().slideToggle(400);
450			
451			$(this).toggleClass('abierto');
452			
453			
454			return false;
455				
456}
457
458
459function vistasherramientas(){
460
461var tipovista = this.innerHTML;//.index();
462
463
464switch (tipovista){
465	
466	case "vista clasica":
467	$('#herramientas nav ul li:nth-child(1)').fadeOut();
468	
469	$('#herramientas #vistas ').animate({top:30});
470	$('#herramientas').animate({height:'400px'},function (){$('#herramientas nav ul li:nth-child(2)').fadeIn();} );
471	$('#herramientas nav ul li:nth-child(3)').removeClass('active');
472	
473	hah = false;
474	
475	
476	break;
477	
478	case "ver todos":
479	$('#herramientas nav ul li:nth-child(2)').fadeOut();
480	
481	$('#herramientas #vistas ').animate({top:'-' +(( $('#clasica').height() + 70))+'px'});
482	$('#herramientas nav ul li:nth-child(3)').removeClass('active');
483	$('#herramientas').animate({height:'600px'},function (){$('#herramientas nav ul li:nth-child(1)').fadeIn(); });
484
485	hah = true;
486	
487
488	
489	break;
490	
491	case "favoritos":
492	$(this).addClass('active');
493	
494	$('#herramientas #vistas ').animate({top:'-' +(( $('#clasica').height() + $('#todos').height() + 190))+'px'});
495	$('#herramientas').animate({height:'400px'});
496	hah = false;
497	
498	break;
499	
500	
501	
502	
503	}	
504}
505
506
507
508
509function  validarbusqueda () {  
510 
511	if($("#buscar").val().length < 1) { 
512		
513	
514		$('#bu').toggleClass('shake');
515		$('#buscar').toggleClass('shake', 100, quitarb);
516		
517	 return false;  
518    }    
519	  
520    return false;  
521} 
522
523
524/*function quitarb (){
525
526$('#bu ').removeClass('shake');
527$('#buscar').removeClass('shake');}
528
529
530function quitarb() { 
531      setTimeout(function() {
532		  
533		
534       $('form #bu').removeClass('shake');
535		$('form #buscar').removeClass('shake');
536     }, 1000 );
537    }
538	
539function slider() { 	
540	
541$('.iosSlider').iosSlider({
542					desktopClickDrag: true,
543					snapToChildren: true,
544					infiniteSlider: true,
545					navNextSelector: $('#clasica .next'),
546					navPrevSelector: $('#clasica .prev'),
547					navSlideSelector: '.selectors .item',
548					onSlideChange: slideChange,
549					autoSlide: false,
550					scrollbar: true,
551					scrollbarContainer: '.sliderContainer .scrollbarContainer',
552					scrollbarMargin: '0',
553					scrollbarBorderRadius: '0',
554					keyboardControls: true
555				});
556				
557		
558			
559}
560
561function slider2() { 	
562	
563$('.iosSlider2').iosSlider({
564					desktopClickDrag: true,
565					snapToChildren: true,
566					infiniteSlider: true,
567					navNextSelector: $('#favoritos .next'),
568					navPrevSelector: $('#favoritos .prev'),
569					navSlideSelector: '.selectors2 .item',
570					onSlideChange: slideChange2,
571					autoSlide: false,
572					scrollbar: true,
573					scrollbarContainer: '.sliderContainer .scrollbarContainer',
574					scrollbarMargin: '0',
575					scrollbarBorderRadius: '0',
576					keyboardControls: true
577				});
578				
579		
580			
581}
582
583
584
585
586function slideChange(args) {
587						
588				
589				$(' .selectors .item').removeClass('selected'); 
590				$(' .selectors .item:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
591				
592			
593			}
594
595function slideChange2(args) {
596						
597				
598				$(' .selectors2 .item').removeClass('selected'); 
599				$(' .selectors2 .item:eq(' + (args.currentSlideNumber - 1) + ')').addClass('selected');
600				
601			
602			}	
603			
604				
605$(window).scroll(function() {
606 		mostrarUpbtm();
607
608});
609
610
611function  mostrarUpbtm(){
612	
613	if ($(document).scrollTop() > 250){
614		$('.arriba').stop().animate({right:'-5px'},200);
615		
616		}
617	else{ $('.arriba').stop().animate({right:'-150px'},100);}
618
619
620}
621
622
623function totop(){
624	
625	$("html, body").animate({ scrollTop: 0 }, "slow");
626	
627	}
628
629
630
631
632
633*/
634
635// Generated by CoffeeScript 1.7.1
636
637/**
638@license Sticky-kit v1.1.1 | WTFPL | Leaf Corcoran 2014 | http://leafo.net
639 */
640

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.