button的onmouseover、onmouseout该如何写 跟onclick是不是冲突啊
解决方案 »
- 查询方法已经写好,请教一个把查询结果显示的方法和控件?希望给出绑定的详细代码。
- 如何通过双击节点展开treeview,再双击折叠呢?
- 使用自定义控件后引起的findcontrol的问题,50分!
- 如何用程序实现将WORD等文档转换成PDF文档
- js+服务器变量组合的问题
- 怎样得到postback是由哪个控件的哪个事件引起的?
- 网站招标
- 关于中文文件名是乱吗!!!!!!!!!!!!!!!!!!!!!!!!
- 100分!谁能够提供datagrid 的编辑框为radioButtonList(从数据库选择),点击编辑后选择一项,再存入数据库
- 一个关于 forecolor 的问题
- 为什么在断点停止程序后仍然执行了断点后的代码?
- 传智播客说sqlhelper是小网站用的,大项目用三层, 用SQLHELPER会累死
{
if (as_type== "truck ")
{
document.all( "wy_list ").style.visibility = "flase ";
}
else
{
document.all( "wy_list ").style.visibility = "true ";
}
} js里这样写 protected void Page_Load(object sender, EventArgs e)
{
wuyi.Attributes.Add("OnmouseOver", "changetype('truck')");
}Page_Load里这样
onmouseout是鼠标移开该控件时就触发的事件
onclick就不说了,是点击时才触发的。
触发的时机不同,所以不冲突
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<style type="text/css">
<!--
#test1{
width:50%;
margin:0px auto;
padding:5px;
}
.border1{
background:#ADE9AE ;
border:dotted 1px #ff0000;
}
.border2{
background:#ffffff;
border:solid 1px #00ff00;
}
-->
</style>
<script type="text/javascript">
function changeColor(){
var test;
test=document.getElementById("test1");
test.onmouseover=function(){
test.className='border1';
}
test.onmouseout=function(){
test.className='border2';
} }
window.onload=changeColor;
</script>
</head>
<body>
<div id="test1" class="border2">
TTTTTTTTTTTTTT
</div>
</body>
</html>
服务器控件按钮 可以直接用onmouseover么?
我试了 不成功。。
{
document.getElementById("wy_list").style.visibility="visible";
}
function closediv()
{
document.getElementById("wy_list").style.visibility="hidden";
} function showdiv()
{
document.getElementById("wy_list").style.visibility="visible";
}
function closediv()
{
document.getElementById("wy_list").style.visibility="hidden";
}这样能实现显示/隐藏的效果了 但是我没法选择弹出的菜单里的东西 移开按钮 菜单就隐藏了...
{
document.getElementById("wy_list").style.visibility="visible";
}
function closediv()
{
document.getElementById("wy_list").style.visibility="hidden";
}
<asp:Button ID="wuyi" runat="server" BackColor="#6666FF" Text="五一社区"
onclick="wuyi_Click" onmouseover="showdiv()" onmouseout="closediv()" />这样子