javascript方式: 熟悉使用document.getElementById()取得节点对象
.div_n {
width : 300px ;
height : 250px ;
border : 1px solid gray ;
}
function changeSrc1()
{
document.getElementById( " myImage " ).src = " /images/2.gif "
}
function changeSrc2()
{
document.getElementById( " myImage " ).src = " /images/1.gif "
}
css+div方式: 合理控制层的样式
New Document
.main {
width : 300px ;
height : 250px ;
border : 1px solid gray ;
}
.content {
width : 150px ;
height : 160px ;
border : 1px solid gray ;
background-image : url(images/2.gif) ;
background-repeat : no-repeat ;
}
.content:hover {
background-image : url(images/3.jpg) ;
}
a {
text-decoration : none ;
}
查看更多关于css+div及javascript应用---------鼠标经过时图片变换的两种方法_html/c的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did102355