1、例如:我有一个TextBox控件,当我点击TextBox时候会弹出日历,但是我不想按日历上面的关闭按钮,只要我鼠标放在页
面别的地方就自动关闭,这个功能怎么实现?
2、这个是调用那个日历函数。
<asp:TextBox ID="txt_OrderDateEnd" runat="server" Width="120px" onfocus="HS_setDate(this)"></asp:TextBox>
请大家说具体一点,我试了几次焦点失去都不行,谢谢了!
面别的地方就自动关闭,这个功能怎么实现?
2、这个是调用那个日历函数。
<asp:TextBox ID="txt_OrderDateEnd" runat="server" Width="120px" onfocus="HS_setDate(this)"></asp:TextBox>
请大家说具体一点,我试了几次焦点失去都不行,谢谢了!
你这个日期控件是自己写的还是什么?
你可以参考一下my97date.
onmouseenter 当用户将鼠标指针移动到对象内时触发。
onmouseleave 当用户将鼠标指针移出对象边界时触发。
document.onclick=function(event) {//点击页面其他地方关闭div
var e = event || window.event;
var elem = e.srcElement || e.target;
while (elem) {
if (elem.className == "aa") {//点击这些元素不关闭div
return;
}
elem = elem.parentNode;
}
关闭日历();
}这样试试
var popwin;
function openwin()
{
popwin=window.open("页面或者层","","resizable=1,width=800,height=200,left=0,top=0")
}
function closewin()
{
popwin.close();
}
</script>
<asp:TextBox ID="TextBox1" onmouseover="openwin()" onmouseout="closewin()" runat="server"></asp:TextBox>
</div>
也可以按照楼上说的添加两个事件来实现