哦,长见识!不过弄这么复杂为啥呀?代码保护?保护不了吧?!function webIMContextMenuHandler(e) { var obj=window.event||e; obj=obj.srcElement||obj.target; while(obj&&obj.tagName!="TD"){if(obj.id && obj.id.indexOf("CsdnWebIM_")==0) break; obj=obj.parentNode;} //if(!obj.id || obj.id.indexOf("CsdnWebIM_")==-1) return true; var data={}; var trigger = "sectionCaption"; var cm = new MzPopupMenu(); var i = obj.id.indexOf("_") + 1; var type = obj.id.substring(i, obj.id.indexOf("_", i)).toLowerCase(); ...不能贴太多,免得伤和气,哈顺便问下 梅大侠,JavaScript 那个职位还招人不?今天发简历还有效不?
<input type="password" id="txtPwd" name="txtPwd" onclick="SoftKeyboard(this)" readonly="readonly"> 把 popup 的隐藏行为放到主页面的 body 的 onmouseover 事件里去
我主要是因想做个能突破框架的下拉菜单,不知楼上的还有没有方法?如下,我把上面的文件放到<iframe>中当鼠标移开时,打开的菜单窗口没有动静!
<!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=shift_jis" />
<title>无标题文档</title>
</head><body>
<!--Untitled-3.html为上面代码的文件-->
<iframe src="Untitled-3.html" ></iframe>
</body>
</html>
今天看到 梅大侠 出手,俺就没上手,不过看来大侠比较忙,没工夫给你弄,
那俺就献丑了!顺便问下 梅大侠,JavaScript 那个职位还招人不?今天发简历还有效不?基本思路:利用延时关闭。
注:当然如果 popup 窗口里的 Td 上还有 onmouseover 和 onmouseout 事件,
千万记得要累加事件,不然就会覆盖原先的事件设置。Untitled-3.html 代码如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta name="Generator" content="EditPlus">
<title>Modify by yixianggao</title><script language="javascript">var oPopUp = null;var bIsHide = false;
var iDelayMilliseconds = 200;
var iTimerID = null;function delayHide()
{
if (bIsHide)
{
oPopUp.hide();
}
}
function SoftKeyboard(pwdObj)
{
oPopUp = window.createPopup(); var popBody = oPopUp.document.body; WriteToPopup(oPopUp,pwdObj); var collObjects = oPopUp.document.body.getElementsByTagName("*");
for (var i=0; i<collObjects.length; i++)
{
collObjects[i].onmouseover = function() {
bIsHide = false;
window.clearTimeout(iTimerID);
};
collObjects[i].onmouseout = function() {
bIsHide = true;
iTimerID = window.setTimeout(delayHide, iDelayMilliseconds);
};
} oPopUp.show(0,20,400,200,pwdObj);
}
function WriteToPopup(oPopUp)
{
var strHTML="<html><head>";
strHTML+='<meta http-equiv="Content-Type" content="text/html; charset=gb2312">';
strHTML+='<title>test</title></head><body style="margin:0; border:0;overflow:hidden;">';
strHTML+='<div>';
strHTML+='<table id="t1" cellpadding="0" cellspacing="0" border="1" style="table-layout:fixed;width:100%;height:100%;"'; strHTML+=' bordercolor="red"><tr><td>this is a test ! </tr><tr><td>this is a test ! </tr><tr><td>this is a test ! ';
strHTML+=' </tr><tr><td>this is a test ! </tr><tr><td>this is a test ! </tr><tr><td>this is a test ! </td></tr>'; strHTML+='</table></div></body></html>'; oPopUp.document.write(strHTML);
}
</script>
</head><body>
<input type="password" id="txtPwd" name="txtPwd" onclick="SoftKeyboard(this)" readonly="readonly">
</body></html>
兄弟真是细心呀,多谢提醒!body 里加上 梅大侠 那句就天衣无缝了,哈,L@@K<body onmouseover="if(oPopUp) oPopUp.hide()">
<input type="password" id="txtPwd" name="txtPwd" onclick="SoftKeyboard(this)" readonly="readonly">
</body>
http://webim.csdn.net/im.htm脚本地址
http://webim.csdn.net/ui/scripts/jsframework.js不过消息页面里以下这句是关键,可是不明白,大侠请指教!<script type="text/javascript">/*<![CDADA[*/Include("Csdn.IM.IndexPage");/*]]>*/</script>