您当前所在位置:
88好学网范文常识生活常识电脑常识js:网页按钮颜色变化的代码» 正文

js:网页按钮颜色变化的代码

[05-26 12:49:15]   来源:http://www.88haoxue.com  电脑常识   阅读:680

概要:js:网页按钮颜色变化的代码鼠标移入移出时颜色变化<input type="submit" value="找吧" name="B1" onMouseOut=this.style.color="blue"onMouseOver=this.style.color="red" class="button">详细实例: 点击代码,可查看演示效果: <style> <!-- .initial2{font-weight:bold;background-color:lime} //--> </style> <script> <!-- function change(color){

js:网页按钮颜色变化的代码,标签:电脑常识大全,http://www.88haoxue.com

js:网页按钮颜色变化的代码

鼠标移入移出时颜色变化

<input type="submit" value="找吧" name="B1" onMouseOut=this.style.color="blue"

onMouseOver=this.style.color="red" class="button">

详细实例:

点击代码,可查看演示效果:

<style>
<!--
.initial2{font-weight:bold;background-color:lime}
//-->
</style>

<script>
<!--

function change(color){
var el=event.srcElement
if (el.tagName=="INPUT"&&el.type=="button")
event.srcElement.style.backgroundColor=color
}

function jumpto2(url){
window.location=url
}

//-->
</script>
<!--onMouseover是鼠标移上去时的颜色,onMouseout是鼠标离开时的颜色-->
<form onMouseover="change('00ccff')" onMouseout="change('ffcccc')">
<input type="button" value="返回目录 " class="css5" onClick="jumpto2('http://www.fengfly.com')">
</form>


Tag:电脑常识电脑常识大全生活常识 - 电脑常识
》《js:网页按钮颜色变化的代码》相关文章