clam2020/public/js/app.js

70 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-10-05 16:13:30 +00:00
function routeMenu(){
var ruta = window.location.pathname.split(".")[0];
$("ul#menu li").removeClass("active");
switch(ruta){
case "/":
$("li#home").addClass("active");
break;
case "/programa":
2018-10-05 16:13:30 +00:00
$("li#program").addClass("active");
break;
2018-10-17 18:29:24 +00:00
/*case "/committees":
2018-10-05 16:13:30 +00:00
$("li#committees").addClass("active");
2018-10-17 18:29:24 +00:00
break;*/
case "/plenaryspeakers":
$("li#plenaryspeakers").addClass("active");
2018-10-05 16:13:30 +00:00
break;
case "/registrarse":
2018-10-05 16:13:30 +00:00
$("li#registration").addClass("active");
break;
case "/participantes":
2018-10-05 16:13:30 +00:00
$("li#participants").addClass("active");
break;
case "/informacion-practica":
2018-10-05 16:13:30 +00:00
$("li#practicalinfo").addClass("active");
break;
default:
}
}
$(document).ready(function(){
routeMenu();
2018-10-17 18:29:24 +00:00
//var margin = $(".container").css("margin-left");
2018-10-05 16:13:30 +00:00
//$("#menu").css("margin-left",margin);
$('#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);
}
console.log(data)
});
post.fail(function(error){
console.log(error)
});
}
});
});