clam2020/public/js/app.js

76 lines
1.9 KiB
JavaScript
Raw Normal View History

2019-12-27 19:40:25 +00:00
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:
}
2018-10-05 16:13:30 +00:00
}
2019-12-27 19:40:25 +00:00
$(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);
2018-10-05 16:13:30 +00:00
}
2019-12-27 19:40:25 +00:00
console.log(data);
});
post.fail(function(error) {
console.log(error);
});
}
});
2018-10-05 16:13:30 +00:00
});