当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 自定义 IE 鼠标右键弹出式

Javascript
颜色渐变效果
用户输入密码的强度
子父窗口之间的操作
破解Session cookie的方法
检测用户按键
[JS]点出统计器
js选择日期
本窗口将在秒后自动关闭
非常酷的有农历的日历挂历!
COOL而实用的动态效果
不错显示时间特效
设为首页,加入收藏
document对象execCommand的command参数介绍
超酷右下浮出广告窗口代码
两边静止的广告条
表单提交(插入效果)javascript
状态栏(status)特效
一个特帅的展示图片的js+css
打印/预览/设置的客户端代码
创建表格,并添加事件

Javascript 中的 自定义 IE 鼠标右键弹出式


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 356 ::
收藏到网摘: n/a

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自定义鼠标右键弹出式菜单</title>
<style type="text/css">
<!--
.div1 { border-top:buttonface 1px solid;border-left:buttonface 1px solid;border-bottom:windowframe 1px solid;border-right:windowframe 1px solid;}
.div2 { border-top:window 1px solid;border-left:window 1px solid;border-bottom:buttonshadow 1px solid;border-right:buttonshadow 1px solid;}
.MouseOver {background-color:highlight;color:highlighttext;font-size: 12px;cursor:hand;font-size: 12px;}
.MouseOut {background-color:buttonface;color:buttontext;font-size: 12px;cursor:default;font-size: 12px;}
-->
</style>
<script language="javascript">
function PopupMouseRightButtonUpMenu()
{
 if(MouseMenu.style.visibility=='visible') MouseMenu.style.visibility='hidden';
 if (event.srcElement.tagName=='A' || event.srcElement.tagName=='TEXTAREA' || event.srcElement.tagName=='INPUT' || document.selection.type!='None')
    return true;
 else
    {
     if (event.clientX+150 > document.body.clientWidth) MouseMenu.style.left=event.clientX+document.body.scrollLeft-150;
     else MouseMenu.style.left=event.clientX+document.body.scrollLeft;
     if (event.clientY+DivH > document.body.clientHeight) MouseMenu.style.top=event.clientY+document.body.scrollTop-DivH;
     else MouseMenu.style.top=event.clientY+document.body.scrollTop;
     MouseMenu.style.visibility='visible';
    }
return false;
}
function DrawMouseRightButtonUpMenu(){
DivH=2;
//oSelection = document.selection;
var HrStr='<tr><td align=\"center\" valign=\"middle\" height=\"2\"><TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"128\" height=\"2\"><tr><td height=\"1\" bgcolor=\"buttonshadow\"><\/td><\/tr><tr><td height=\"1\" bgcolor=\"buttonhighlight\"><\/td><\/tr><\/TABLE><\/td><\/tr>';
var MenuItemStr1='<tr><td align=\"center\" valign=\"middle\" height=\"20\"><TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"132\"><tr><td valign=\"middle\" height=\"16\" class=\"MouseOut\" onMouseOver=\"this.className=\'MouseOver\'\" onMouseOut=\"this.className=\'MouseOut\'\" onclick=\"'
var MenuItemStr2="<\/td><\/tr><\/TABLE><\/td><\/tr>";
var historyMenu=['window.history.back()\">