Hola,
Estoy creando una funcion que me cambie el css:
Código html:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> <!--
function $(id){
return document.getElementById(id);
}
function $css(id,ob){
for (at in ob) {
if(at=="opacity"){
$(id).style.opacity=(ob[at]);
$(id).style.MozOpacity=(ob[at]);
$(id).style.KhtmlOpacity=(ob[at]);
$(id).style.filter="alpha(opacity="+ob[at]+")";
}else{
$(id).setAttribute(at,""+ob[at]);
}
}
}
-->
<div style="height:500px; width:300px; background-color:#666666;" id="divT"></div> <input type="button" onclick="$css('divT',{opacity:'0.8',height:'50px',width:'50px'})" value="Probar" />
El opacity me cambia bien, pero el tamañono.
Gracias
Salu2