五人制足球中场球员:用java script编写函数实现将字体动态变为粗体

来源:百度文库 编辑:神马品牌网 时间:2024/05/04 15:53:55
字体变化函数
1,font_move_on()
鼠标移过来的时候,文字字体变为粗体
2,font_move_out()
鼠标移走的时候,文字字体变为细体

<script language="JavaScript">
function cFont(obj,flag)
{
obj.style.fontWeight = (flag == 1) ? 'bold' : 'normal';
}
</script>
<div onmouseout="cFont(this, 0);" onmouseover="cFont(this, 1);">11111111111111</div>