diff --git a/public/js/app.js b/public/js/app.js index 726ad0c..c574d9b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,73 +1,75 @@ -function routeMenu(){ - var ruta = window.location.pathname.split(".")[0]; - $("ul#menu li").removeClass("active"); - switch(ruta){ - case "/": - $("li#home").addClass("active"); - break; - case "/programa": - $("li#program").addClass("active"); - break; - case "/committees": - $("li#committees").addClass("active"); - break; - case "/conferencias": - $("li#conferencias").addClass("active"); - break; - case "/sesiones": - $("li#sesiones").addClass("active"); - break; - case "/registrarse": - $("li#registration").addClass("active"); - break; - case "/participantes": - $("li#participants").addClass("active"); - break; - case "/informacion-practica": - $("li#practicalinfo").addClass("active"); - break; - default: - } +function routeMenu() { + var ruta = window.location.pathname.split(".")[0]; + $("ul#menu li").removeClass("active"); + + ruta!=='/' && + $([document.documentElement, document.body]).animate( + { + scrollTop: $("#content").offset().top + }, + 2000 + ); + switch (ruta) { + case "/": + $("li#home").addClass("active"); + break; + case "/programa": + $("li#program").addClass("active"); + break; + case "/committees": + $("li#committees").addClass("active"); + break; + case "/conferencias": + $("li#conferencias").addClass("active"); + break; + case "/sesiones": + $("li#sesiones").addClass("active"); + break; + case "/registrarse": + $("li#registration").addClass("active"); + break; + case "/participantes": + $("li#participants").addClass("active"); + break; + case "/informacion-practica": + $("li#practicalinfo").addClass("active"); + break; + default: + } } -$(document).ready(function(){ - routeMenu(); - //var margin = $(".container").css("margin-left"); - //$("#menu").css("margin-left",margin); - var parallaxHeight = $(".parallax-mirror").height() - $("#header").height(parallaxHeight) - $('#contactform').submit(function(event){ - var fail=false; - $("#statusmsg").hide(); - event.preventDefault(); - if($('#g-recaptcha-response').val() == ""){ - $("div.g-recaptcha").tooltip({ - "title":'Marque "No soy un robot"', - "pacement":"right", - "trigger":"manual" - }); - $("div.g-recaptcha").tooltip("show"); - fail=true; +$(document).ready(function() { + routeMenu(); + //var margin = $(".container").css("margin-left"); + //$("#menu").css("margin-left",margin); + var parallaxHeight = $(".parallax-mirror").height(); + $("#header").height(parallaxHeight); + $("#contactform").submit(function(event) { + var fail = false; + $("#statusmsg").hide(); + event.preventDefault(); + if ($("#g-recaptcha-response").val() == "") { + $("div.g-recaptcha").tooltip({ + title: 'Marque "No soy un robot"', + pacement: "right", + trigger: "manual" + }); + $("div.g-recaptcha").tooltip("show"); + fail = true; + } + if (!fail) { + var post = $.post("contact", $(this).serialize()); + post.done(function(data) { + data = $.parseJSON(data); + if (data.success) { + showmsg(data.message, true); + } else { + showmsg(data.message, false); } - if(!fail){ - var post = $.post('contact', $(this).serialize()); - post.done(function(data){ - data = $.parseJSON(data); - if(data.success){ - showmsg(data.message,true); - } - else{ - showmsg(data.message,false); - - } - console.log(data) - - }); - post.fail(function(error){ - console.log(error) - }); - } - }); - - - + console.log(data); + }); + post.fail(function(error) { + console.log(error); + }); + } + }); }); diff --git a/templates/program.html b/templates/program.html index 30edcc1..07e9276 100644 --- a/templates/program.html +++ b/templates/program.html @@ -2,7 +2,7 @@ {% block content %}