agrega scrolldown automatico

This commit is contained in:
Germán Correa 2019-12-27 16:40:25 -03:00
parent 7af2573b37
commit 21a1d4aa26
2 changed files with 73 additions and 71 deletions

View File

@ -1,7 +1,15 @@
function routeMenu(){ function routeMenu() {
var ruta = window.location.pathname.split(".")[0]; var ruta = window.location.pathname.split(".")[0];
$("ul#menu li").removeClass("active"); $("ul#menu li").removeClass("active");
switch(ruta){
ruta!=='/' &&
$([document.documentElement, document.body]).animate(
{
scrollTop: $("#content").offset().top
},
2000
);
switch (ruta) {
case "/": case "/":
$("li#home").addClass("active"); $("li#home").addClass("active");
break; break;
@ -29,45 +37,39 @@ function routeMenu(){
default: default:
} }
} }
$(document).ready(function(){ $(document).ready(function() {
routeMenu(); routeMenu();
//var margin = $(".container").css("margin-left"); //var margin = $(".container").css("margin-left");
//$("#menu").css("margin-left",margin); //$("#menu").css("margin-left",margin);
var parallaxHeight = $(".parallax-mirror").height() var parallaxHeight = $(".parallax-mirror").height();
$("#header").height(parallaxHeight) $("#header").height(parallaxHeight);
$('#contactform').submit(function(event){ $("#contactform").submit(function(event) {
var fail=false; var fail = false;
$("#statusmsg").hide(); $("#statusmsg").hide();
event.preventDefault(); event.preventDefault();
if($('#g-recaptcha-response').val() == ""){ if ($("#g-recaptcha-response").val() == "") {
$("div.g-recaptcha").tooltip({ $("div.g-recaptcha").tooltip({
"title":'Marque "No soy un robot"', title: 'Marque "No soy un robot"',
"pacement":"right", pacement: "right",
"trigger":"manual" trigger: "manual"
}); });
$("div.g-recaptcha").tooltip("show"); $("div.g-recaptcha").tooltip("show");
fail=true; fail = true;
} }
if(!fail){ if (!fail) {
var post = $.post('contact', $(this).serialize()); var post = $.post("contact", $(this).serialize());
post.done(function(data){ post.done(function(data) {
data = $.parseJSON(data); data = $.parseJSON(data);
if(data.success){ if (data.success) {
showmsg(data.message,true); showmsg(data.message, true);
} else {
showmsg(data.message, false);
} }
else{ console.log(data);
showmsg(data.message,false);
}
console.log(data)
}); });
post.fail(function(error){ post.fail(function(error) {
console.log(error) console.log(error);
}); });
} }
}); });
}); });

View File

@ -2,7 +2,7 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<h1><strong>Programa</strong> </h1> <h1 id="programa"><strong>Programa</strong> </h1>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="alert alert-info"> <div class="alert alert-info">
<i class="glyphicon glyphicon-info-sign"></i> <strong>To be announced</strong><br/> <i class="glyphicon glyphicon-info-sign"></i> <strong>To be announced</strong><br/>