| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- window.onload = function() {
- var availableWidth = [ 500, 1024, 1400, 1920];
- var size=0;
- var banner=document.getElementById("banner");
- while ($(window).width() > availableWidth[size] && size < availableWidth.length-1 )
- size++;
- banner.src="Images/slider/slide1-"+availableWidth[size]+".jpg";
- var contact= document.getElementsByClassName("contact");
- var tit_curso = document.getElementsByClassName("titulo_curso");
- var desc_curso = document.getElementsByClassName("descripcion_curso");
- function curso_click(){
- for(var j =0; j < desc_curso.length; j++){
- if (desc_curso[j].getAttribute("tatosa") == this.getAttribute("tatosa"))
- desc_curso[j].style.display="block";
- }
- }
- for(var i =0; i < tit_curso.length; i++)
- tit_curso[i].onclick=curso_click;
- for(var i =0; i < contact.length; i++)
- contact[i].onclick=showContact;
- function showContact() {
- $('.basic-grey, #overlay-contact').toggle();
- if($('.basic-grey').is(':visible')){
- $('#overlay-contact').click(function(){
- $('.basic-grey, #overlay-contact').hide();
- });
- $('#exit').click(function(){
- $('.basic-grey, #overlay-contact').hide();
- });
- }
- }
- $('li a').click(function () {
- $('html, body').animate({ scrollTop: $($(this).attr('href')).position().top }, 'slow');
- if ($(this).attr('href')=='#footer-outer') { showContact(); }
- return false;
- });
- // $('.menu').hide(); //TATII!!!
- $('#responsive-menu').click(function(){
- $('.menu').slideToggle(300);
- });
- var startY= $('#top_wrapper').position().top + $('#top_wrapper').outerHeight();
- $('#logo').css('opacity','0');
- $('#navlist').css('height','55px');
- $(window).scroll(function () {
- if($(this).scrollTop() > startY ){
- $('#logo').css({'opacity':'1', 'transition': 'opacity 0.5s ease-in-out'});
- }else{
- $('#logo').css({'opacity':'0', 'transition': 'opacity 0.5s ease-in-out'});
- }
- });
- $("#btnconsulta").click(function() {
- $.post('contacto.php',{nombre: $("#name").val(), mail:$("#email").val(),consulta:$("#message").val()}).done(function(data) {
- $("#respuestacontacto").html(data);
- });
- });
- $("#ok").click(function() {
- $.post('newsletter.php',{mail:$("#suscribe").val()}).done(function(data) {
- $("#respuestanewsletter").html(data);
- });
- });
- var curImg=1;
- setInterval(slide, 8000);
- function slide() {
- banner.className='transp';
- setTimeout(transp, 500);
- curImg++;
- if(curImg>5) curImg=1;
- }
- function transp() {
- banner.src="Images/slider/slide"+curImg+"-"+availableWidth[size]+".jpg";
- banner.removeAttribute('class');
- }
- }
|