鼠标右键菜单问题(仿网络蚂蚁在右键上出现下载选项) 你还是给用户做个专用浏览器吧 要么让微软帮你定制一个 这年头怎么都这么喜欢打浏览器的主意啊 俺最讨厌这一套了 你看人家csdn的界面 整天来这里难道就没有一点启发? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 网络蚂蚁是安装在客户机上的,浏览器是客户机的asp是服务器端编译的不知道这样说你知道了没? 他的实现我都知道,而且也看过代码,不过他用的是VB Script,我想用JS来实现却找不到相关的对象 <HTML><HEAD><TITLE>右键菜单的淡入淡出效果</TITLE><META content="text/html; charset=gb2312" http-equiv=Content-Type><SCRIPT language=JavaScript><!-- // RightClickMenuvar intDelay=100; //设置菜单显示速度,越大越慢var intInterval=5; //每次更改的透明度 function showmenuie5(){var rightedge=document.body.clientWidth-event.clientXvar bottomedge=document.body.clientHeight-event.clientYif (rightedge<ie5menu.offsetWidth)ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidthelseie5menu.style.left=document.body.scrollLeft+event.clientXif (bottomedge<ie5menu.offsetHeight)ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeightelseie5menu.style.top=document.body.scrollTop+event.clientYie5menu.style.visibility="visible"//ie5menu.style.visibility=""ie5menu.filters.alpha.opacity=0GradientShow()return false}function hidemenuie5(){//ie5menu.style.visibility="hidden"GradientClose()}function highlightie5(){if (event.srcElement.className=="menuitems"){event.srcElement.style.backgroundColor="highlight"event.srcElement.style.color="white"}}function lowlightie5(){if (event.srcElement.className=="menuitems"){event.srcElement.style.backgroundColor=""event.srcElement.style.color="#000000"}} function jumptoie5(){if (event.srcElement.className=="menuitems"){if (event.srcElement.url != ''){if (event.srcElement.getAttribute("target")!=null)window.open(event.srcElement.url,event.srcElement.getAttribute("target"))elsewindow.location=event.srcElement.url}}} function GradientShow() //实现淡入的函数 { ie5menu.filters.alpha.opacity+=intInterval if (ie5menu.filters.alpha.opacity<100) setTimeout("GradientShow()",intDelay)} function GradientClose() //实现淡出的函数 { ie5menu.filters.alpha.opacity-=intInterval if (ie5menu.filters.alpha.opacity>0) { setTimeout("GradientClose()",intDelay) } else { ie5menu.style.visibility="hidden" } } function ChangeBG() //改变菜单项的背景颜色,这里的两种颜色值可以改为你需要的 { oEl=event.srcElement if (oEl.style.background!="navy") { oEl.style.background="navy" } else { oEl.style.background="#cccccc" } } // --></SCRIPT> <STYLE type=text/css>.cMenu {FILTER: alpha(opacity=0);BACKGROUND-COLOR: #D6D3CE;BORDER-BOTTOM: #666666 2px solid; BORDER-LEFT: #E4E4E4 2px solid; BORDER-RIGHT: #666666 2px solid; BORDER-TOP: #E4E4E4 2px solid; COLOR: #000000; CURSOR: default; FONT-SIZE: 9pt; color:#000000;FONT-WEIGHT: normal; LINE-HEIGHT: 20px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 110px}.menuitems {font-size:9pt;MARGIN: 2px;PADDING-BOTTOM: 0px; PADDING-LEFT: 15px; PADDING-RIGHT: 3px; PADDING-TOP: 0px;}</STYLE> <META content="Microsoft FrontPage 4.0" name=GENERATOR></HEAD><BODY><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT><RIGHTCLICK><!--[if IE]><DIV class=cMenu id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5() onmouseover=highlightie5()> <DIV class=menuitems url="javascript:click_obj(0)">后退</DIV><DIV class=menuitems url="javascript:click_obj(1)">前进</DIV><DIV class=menuhr><hr style="width:100%"></DIV><DIV class=menuitems url="javascript:click_obj(2)">刷新</DIV><DIV class=menuitems url="javascript:click_obj(3)">加入收藏夹</DIV><DIV class=menuitems url="javascript:click_obj(4)">查看源文件</DIV><DIV class=menuhr><hr style="width:100%"></DIV><DIV class=menuitems url="javascript:click_obj(5)">属性</DIV> </DIV><![endif]--> <SCRIPT language=JavaScript><!--function click_obj(id){switch(id){case 0: history.back()breakcase 1:history.forward()breakcase 2:window.location.reload()breakcase 3:window.external.AddFavorite(location.href, document.title)breakcase 4:window.location = "view-source:" + window.location.hrefbreakcase 5:document.all.WebBrowser.ExecWB(10,1)break}} if (document.all&&window.print){ie5menu.className="cMenu"document.oncontextmenu=showmenuie5document.body.onclick=hidemenuie5}//--></SCRIPT></RIGHTCLICK></BODY></HTML set JetCarCatch=CreateObject("JetCar.Netscape")这是网际快车里的一句呵呵 回“没穿裤子”,呵呵,这好象也是VB Script的吧,有没有Java Script的? 回“没穿裤子”,呵呵,这好象也是VB Script的吧,有没有Java Script的?----------------------------------------------------------看来你没明白我的意思 <script language="javascript">function goUrl(url){ location.href=url }function OnContextMenu(){ var srcLocation = external.menuArguments.location; goUrl(srcLocation);} OnContextMenu();</script> HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\test默认 xxxx.htmContexts 22(16进制) external.menuArguments.locationthat is what I need. thanks 顺便问一句,在哪里有关于external的文档 js匹配以310开头,至少12位数字结尾的值 模态对话框的location问题 推荐关于jQUERY方面的书籍(特别是入门的)...... 加快图片的滚动速度 哪里有张孝详的javascript下载 请问function.prototype.x和function.x有何不同? jquery easyui-datebox渲染问题 新手发问:请解释一下这段代码 怎么实现点击一个按纽弹出一个带有很多输入框的web对话框? 路过的也进来看看!!! 新手问题1:如何扩展对象类型 求javascript通用检测代码,要求能够正确判断"·"等特殊中文符号为中文字符的
asp是服务器端编译的
不知道这样说你知道了没?
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<SCRIPT language=JavaScript>
<!-- // RightClickMenu
var intDelay=100; //设置菜单显示速度,越大越慢
var intInterval=5; //每次更改的透明度
function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY
if (rightedge<ie5menu.offsetWidth)
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
ie5menu.style.left=document.body.scrollLeft+event.clientX
if (bottomedge<ie5menu.offsetHeight)
ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
else
ie5menu.style.top=document.body.scrollTop+event.clientY
ie5menu.style.visibility="visible"
//ie5menu.style.visibility=""
ie5menu.filters.alpha.opacity=0
GradientShow()
return false
}
function hidemenuie5(){
//ie5menu.style.visibility="hidden"
GradientClose()
}
function highlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor="highlight"
event.srcElement.style.color="white"
}
}
function lowlightie5(){
if (event.srcElement.className=="menuitems"){
event.srcElement.style.backgroundColor=""
event.srcElement.style.color="#000000"
}
}
function jumptoie5(){
if (event.srcElement.className=="menuitems"){
if (event.srcElement.url != ''){
if (event.srcElement.getAttribute("target")!=null)
window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
else
window.location=event.srcElement.url
}
}
} function GradientShow() //实现淡入的函数
{
ie5menu.filters.alpha.opacity+=intInterval
if (ie5menu.filters.alpha.opacity<100) setTimeout("GradientShow()",intDelay)
} function GradientClose() //实现淡出的函数
{
ie5menu.filters.alpha.opacity-=intInterval
if (ie5menu.filters.alpha.opacity>0) {
setTimeout("GradientClose()",intDelay)
}
else {
ie5menu.style.visibility="hidden"
}
} function ChangeBG() //改变菜单项的背景颜色,这里的两种颜色值可以改为你需要的
{
oEl=event.srcElement
if (oEl.style.background!="navy") {
oEl.style.background="navy"
}
else {
oEl.style.background="#cccccc"
}
}
// -->
</SCRIPT> <STYLE type=text/css>
.cMenu {
FILTER: alpha(opacity=0);BACKGROUND-COLOR: #D6D3CE;BORDER-BOTTOM: #666666 2px solid; BORDER-LEFT: #E4E4E4 2px solid; BORDER-RIGHT: #666666 2px solid; BORDER-TOP: #E4E4E4 2px solid; COLOR: #000000; CURSOR: default; FONT-SIZE: 9pt; color:#000000;FONT-WEIGHT: normal; LINE-HEIGHT: 20px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 110px
}
.menuitems {
font-size:9pt;
MARGIN: 2px;
PADDING-BOTTOM: 0px;
PADDING-LEFT: 15px;
PADDING-RIGHT: 3px;
PADDING-TOP: 0px;
}
</STYLE> <META content="Microsoft FrontPage 4.0" name=GENERATOR>
</HEAD>
<BODY>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0>
</OBJECT>
<RIGHTCLICK><!--[if IE]>
<DIV class=cMenu id=ie5menu onclick=jumptoie5() onmouseout=lowlightie5()
onmouseover=highlightie5()> <DIV class=menuitems url="javascript:click_obj(0)">后退</DIV>
<DIV class=menuitems url="javascript:click_obj(1)">前进</DIV>
<DIV class=menuhr><hr style="width:100%"></DIV>
<DIV class=menuitems url="javascript:click_obj(2)">刷新</DIV>
<DIV class=menuitems url="javascript:click_obj(3)">加入收藏夹</DIV>
<DIV class=menuitems url="javascript:click_obj(4)">查看源文件</DIV>
<DIV class=menuhr><hr style="width:100%"></DIV>
<DIV class=menuitems url="javascript:click_obj(5)">属性</DIV> </DIV>
<![endif]--> <SCRIPT language=JavaScript>
<!--
function click_obj(id){
switch(id){
case 0:
history.back()
break
case 1:
history.forward()
break
case 2:
window.location.reload()
break
case 3:
window.external.AddFavorite(location.href, document.title)
break
case 4:
window.location = "view-source:" + window.location.href
break
case 5:
document.all.WebBrowser.ExecWB(10,1)
break
}
} if (document.all&&window.print){
ie5menu.className="cMenu"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
//-->
</SCRIPT>
</RIGHTCLICK>
</BODY></HTML
这是网际快车里的一句
呵呵
看来你没明白我的意思
location.href=url
}function OnContextMenu(){
var srcLocation = external.menuArguments.location;
goUrl(srcLocation);
} OnContextMenu();</script>
默认 xxxx.htm
Contexts 22(16进制)
that is what I need. thanks