![]() |
| Fuente: rooibo.wordpress.com |
Función javascript
function
initBoton() {
var
obj = document.getElementById(“boton”);
var
myWidth = 0, myHeight = 0;
if(
typeof( window.innerWidth ) == ‘number’ ) {
//Non-IE
myWidth
= window.innerWidth;
myHeight
= window.innerHeight;
}
else if( document.documentElement && (
document.documentElement.clientWidth ||
document.documentElement.clientHeight ) ) {
//IE
6+ in ‘standards compliant mode’
myWidth
= document.documentElement.clientWidth;
myHeight
= document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {
//IE
4 compatible
myWidth
= document.body.clientWidth;
myHeight
= document.body.clientHeight;
}
var
finalW = myWidth-910;
finalW
= finalW/2;
//910-722
= 188 (mas tamaño…238)
finalW
= finalW + 248;
obj.style.position=’absolute’;
obj.style.right=finalW+’px’;
obj.style.top=’244px’;
obj.style.display=’block’;
}
|
Mediante esta función,
se crea un botón, que al pulsarlo, estarías votando otra noticia
diferente. De forma un poco sucia, se posiciona el botón original
justo debajo del botón para votar la noticia que queremos. El iframe
es algo así:
|
<iframe
src=”http://tec.fresqui.com/cientificos-descubren-que-el
-sol-no-es-una-esfera-perfecta”
style=”opacity:0;position:absolute;top:0px;left:0px;width:99%;
height:95%;margin:0px;padding:0px;z-index:100;”></iframe>
|







0 comentarios:
Publicar un comentario