Ao alterar o estilo de exibição do botão, o deslizamento dinâmico do botão é alcançado
A cópia do código é a seguinte:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // pt" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-bransitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> unt intitulado Documento </title>
</head>
<estilo>
.search {Background:#008800; Cor: #FFF; fronteira: nenhuma; Altura: 26px; altura de linha: 20px; Largura: 63x;}
.searchhover {background:#000099; Cor: #FFF; fronteira: nenhuma; Altura: 26px; altura de linha: 20px; Largura: 63px; }
</style>
</head>
<corpo onload = "js ()">
<input type = "button" id = "btn" name = "btn" value = "login"/>
<input type = "button" id = "btn2" name = "btn" value = "logout"/>
<script type = "text/javascript">
função js ()
{
// FAZENDO O SUPORTE DE BUTTO DE IE6 ATRIBUIÇÃO OBJ, A entidade que deseja apoiar o mouse é o estilo de BTN: Passe, e o init é o estilo inicial
obj = "btn";
alerta (Navigator.AppName);
if (Navigator.appname == "Microsoft Internet Explorer" && parsefloat (Navigator.AppVersion) == 4) {// Julgamento IE6
var o = document.getElementsByName (obj);
for (var i = 0; i <o.length; i ++) {
if (o [i] .Type == "Button") {
//o−i ].className = "Search";
o [i] .onMouseOver = function () {this.className = "Searchhover"}
o [i] .onMouseOut = function () {this.classname = "search"};
}
}
}
}
</script>
</body>
</html>