var numScroll = 0; function votar(col, id, clave) { $("#cargando").show(); var al=Math.floor(Math.random()*65001) $.get("votar.aspx", { co: col, i: id, sid: clave, ra: al, ac: 'vo'}, function(data) { $("#contVotos").html(data); $("#cargando").hide(); }); } function borrar(col, id, clave) { $("#cargando").show(); var al = Math.floor(Math.random() * 65001) $.get("votar.aspx", { co: col, i: id, sid: clave, ra: al, ac: 'de'}, function(data) { $("#contVotos").html(data); $("#cargando").hide(); }); } function limpiar(seleccionado, seccion) { $("#mover").animate({ marginTop: parseInt($("#movedor").scrollTop())-70 + "px" }, 100); var elsid = ''; $(".voto").each(function() { if ($(this).attr('id') != seleccionado) { $(this).html(' '); } else { $(this).html(' '); } }); $(".votoUno").each(function() { if ($(this).attr('id') != seleccionado) { $(this).html(' '); } else { $(this).html(' '); } }); }; function elToggle(id) { $(".cajaComentarios").each(function() { if ($(this).attr('id') != 'com' + id) { $(this).hide(); } else { $(this).toggle(); } }); } function elToggleSi(id) { $(".rsociales").each(function() { if ($(this).attr('id') != 'si' + id) { $(this).hide(); } else { $(this).toggle(); } }); } $(document).ready(function() { $("#movedor").scroll(function() { //setTimeout ( control, 100 ); if (parseInt($("#movedor").scrollTop())==0) { $("#mover").animate({ marginTop: parseInt($(window).scrollTop()) + "px" }, 100); } /*if (parseInt($(window).scrollTop())>(numScroll+100) || parseInt($(window).scrollTop())<(numScroll-100)) { $("#scrollEncabezado").animate({ marginTop: parseInt($(window).scrollTop()) + "px" }, 100); numScroll = parseInt($(window).scrollTop()); }*/ //$("#scrollEncabezado").css("marginTop",parseInt($(window).scrollTop()) + "px"); //$("#mover").css("marginTop",parseInt($(window).scrollTop()) + "px"); }); }); function enviarVotacion() { var cuenta = 0; $(".seleccionable").each(function() { cuenta++; }); if (cuenta == 0) { document.location.href = 'resumenVotacion.aspx?sid='; } else { alert('Lo sentimos pero aún no has votado en todas las categorías'); } }; function control () { if (parseInt($(window).scrollTop())==numScroll) { console.log('Parado'); //$("#scrollEncabezado").animate({ marginTop: parseInt($(window).scrollTop()) + "px" }, 100); $("#scrollEncabezado").css("marginTop",parseInt($(window).scrollTop()) + "px"); //$("#mover").css("marginTop",parseInt($(window).scrollTop()) + "px"); } else { console.log('Moviendo'); } numScroll = parseInt($(window).scrollTop()) } $(document).ready(function() { /* var viewportwidth; var viewportheight; // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth, viewportheight = window.innerHeight } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth, viewportheight = document.documentElement.clientHeight } // older versions of IE else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth, viewportheight = document.getElementsByTagName('body')[0].clientHeight } var labuena = (viewportwidth-865)/2 $("#scrollEncabezado").css("left",labuena + "px");*/ });