$(document).ready(function() { if( $('#current-lang').val() != 'es'){ $('#search-scroll form').attr('action', '/'+$('#current-lang').val()+'/'); $('.tcm-items-menu form').attr('action', '/'+$('#current-lang').val()+'/'); } var lastChar = document.URL.slice(-1); var href = document.URL; if(lastChar == '/'){ href = document.URL.substring(0, document.URL.length - 1); } var page = href.substr(href.lastIndexOf('/') + 1); expresion = /trabaja-con-nosotros\-*[0-9]*/; if( expresion.test(page) && localStorage.getItem('redi') == 'scroll') { localStorage.removeItem('redi'); $('html, body').animate({ scrollTop: $('#trabaja-con-nosotros-seccion-2').offset().top }, 2000); } $('#button-bolsa-empleo a').click(function(e){ e.preventDefault(); var href = this.href; var lastChar = this.href.slice(-1); if(lastChar == '/'){ href = this.href.substring(0, this.href.length - 1); } localStorage.setItem('redi','scroll'); href = href.substr(href.lastIndexOf('/') + 1); window.location.href = '/' + href; }); /** setTimeout(function() { var maxHeight = 0; $('.sectores-6sigma .sectores-content > div > div').each(function (index) { if($(this).height() > maxHeight) maxHeight = $(this).height() }) var totalHeight = maxHeight + 180; $('.sectores-6sigma .sectores-content > div').each(function (index) { $(this).css('height', totalHeight + "px !important"); console.log(totalHeight); console.log($(this)); }); },2000); **/ //Click en menú de página todos los cursos/sectores $('.menu-todos-cursos .menu-item a').click(function (e) { var href = $(this).attr('href'); if(href.indexOf('#') == 0) { e.preventDefault(); $("html, body").animate({ scrollTop: $(href).offset().top - 150 }, 1000); } }); });