Difference between revisions of "Template:Navarra BG/js/funciones"

Line 1: Line 1:
 
$(document).ready(function() {
 
$(document).ready(function() {
 
$('.discover').click(function() {
 
$('.discover').click(function() {
$('#intro').toggleClass('hidden',1000);  
+
$('#intro').toggleClass('hidden',500);  
$('#maindesc').toggleClass('visible',1000);  
+
$('#maindesc').toggleClass('visible',500);  
 
});
 
});
 
});
 
});

Revision as of 07:03, 27 September 2018

$(document).ready(function() { $('.discover').click(function() { $('#intro').toggleClass('hidden',500); $('#maindesc').toggleClass('visible',500); }); });

$(window).scroll(function() {

  var hT = $('#scroll-to').offset().top,

hH = $('#scroll-to').outerHeight(), wH = $(window).height(), wS = $(this).scrollTop();

  if (wS > (hT+hH-wH) && (hT > wS) && (wS+wH > hT+hH)){

$('h1').addClass('view')

  } else {

$('h1').removeClass('view')

  }

});