50分 javascript中右键弹出菜单问题 在线等待 更清楚的讲,就是想在网页中点击右键实现弹出菜单,这个需要使用JAVASCRIPT代码和CSS结合来实现,但具体的代码有些我不是很清楚,所以就以请教各位,把相应的代码告诉一下,并对其做一下详细的解释。谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><style><!--.skin0 {position:absolute;text-align:left;width:200px;border:2px solid black;background-color:menu;font-family:Verdana;line-height:20px;cursor:default;visibility:hidden;}.skin1 {cursor:default;font:menutext;position:absolute;text-align:left;font-family: Arial, Helvetica, sans-serif;font-size: 10pt;width:120px;background-color:menu;border:1 solid buttonface;visibility:hidden;border:2 outset buttonhighlight;}.menuitems {padding-left:15px;padding-right:10px;}--></style> <SCRIPT><!-- Beginvar menuskin = "skin1"; // skin0, or skin1var display_url = 0; // Show URLs in status bar?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;elseie5menu.style.left = document.body.scrollLeft + event.clientX;if (bottomedge <ie5menu.offsetHeight)ie5menu.style.top = document.body.scrollTop + event.clientY -ie5menu.offsetHeight;elseie5menu.style.top = document.body.scrollTop + event.clientY;ie5menu.style.visibility = "visible";return false;}function hidemenuie5() {ie5menu.style.visibility = "hidden";}function highlightie5() {if (event.srcElement.className == "menuitems") {event.srcElement.style.backgroundColor = "highlight";event.srcElement.style.color = "white";if (display_url)window.status = event.srcElement.url;}}function lowlightie5() {if (event.srcElement.className == "menuitems") {event.srcElement.style.backgroundColor = "";event.srcElement.style.color = "black";window.status = "";}}function jumptoie5() {if (event.srcElement.className == "menuitems") {if (event.srcElement.getAttribute("target") != null)window.open(event.srcElement.url, event.srcElement.getAttribute("target"));elsewindow.location = event.srcElement.url;}}// End --></script></head><body><div id="ie5menu" class="skin0" onMouseover="highlightie5()"onMouseout="lowlightie5()" onClick="jumptoie5();"><div class="menuitems" url="javascript:history.back();">返回</div><div class="menuitems" url="http://javacool.3322.net">回首页</div><hr><div class="menuitems" url="http://www.163.com">网易</div><div class="menuitems" url="http://www.sohu.com">搜狐</div><hr><div class="menuitems" url="http://www.sina.com.cn">新浪</div><div class="menuitems" url="http://www.yahoo.com.cn">雅虎</div></div></body></html><script language="JavaScript1.2">if (document.all && window.print) {ie5menu.className = menuskin;document.oncontextmenu = showmenuie5;document.body.onclick = hidemenuie5;}</script> 我觉得这个东西应该是个自定义 JavaScript 类, 包装成一个 HTML 组件。到微软看看 HTML Component 应该怎么写一个简单的例子。 给你发几个关于右键菜单的网址,希望对你有帮助:http://www.blogcn.com/user20/boydreaming/index.htmlhttp://www.cnky.net/forum/dispbbs.asp?boardID=420&ID=141013http://www.xydi.com/design/web/200505/1744.htmlhttp://www.id666.com/js/showjs.asp?js_id=390http://www.pconline.com.cn/pcedu/empolder/wz/javascript/10202/37254.htmlhttp://www.blueidea.com/bbs/newsdetail.asp?id=1491981&page=1&posts=&Daysprune=&lp=1http://csdn.eyeah.cn/3116/1119/1136/265446414.html 时间的查询问题 struts2字段转换问题 求日期控件,要求只要年和月,不要显示日期,不要显示星期,求源码,在线等!!!!! 有ant 站点间如何通讯? APACHE+iis所有二级域名绑定问题 用户登录界面源代码 求救,stuts中的错误返回不了错误页面 多个div层的名字是一样的问题 请问JSP+javaBean乱码问题!!!!!!!!!!!! 我知道网上有很多的方法,可是我就解决不了JSP页面中文问题,请路过的各位看一看 bean 访问数据库的错误
<head>
<style>
<!--.skin0 {position:absolute;text-align:left;width:200px;border:2px solid black;background-color:menu;font-family:Verdana;line-height:20px;cursor:default;visibility:hidden;}.skin1 {cursor:default;font:menutext;position:absolute;text-align:left;font-family: Arial, Helvetica, sans-serif;font-size: 10pt;width:120px;background-color:menu;border:1 solid buttonface;visibility:hidden;border:2 outset buttonhighlight;}.menuitems {padding-left:15px;padding-right:10px;}--></style>
<SCRIPT>
<!-- Beginvar menuskin = "skin1"; // skin0, or skin1var display_url = 0; // Show URLs in status bar?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;elseie5menu.style.left = document.body.scrollLeft + event.clientX;if (bottomedge <ie5menu.offsetHeight)ie5menu.style.top = document.body.scrollTop + event.clientY -ie5menu.offsetHeight;elseie5menu.style.top = document.body.scrollTop + event.clientY;ie5menu.style.visibility = "visible";return false;}function hidemenuie5() {ie5menu.style.visibility = "hidden";}function highlightie5() {if (event.srcElement.className == "menuitems") {event.srcElement.style.backgroundColor = "highlight";event.srcElement.style.color = "white";if (display_url)window.status = event.srcElement.url;}}function lowlightie5() {if (event.srcElement.className == "menuitems") {event.srcElement.style.backgroundColor = "";event.srcElement.style.color = "black";window.status = "";}}function jumptoie5() {if (event.srcElement.className == "menuitems") {if (event.srcElement.getAttribute("target") != null)window.open(event.srcElement.url, event.srcElement.getAttribute("target"));elsewindow.location = event.srcElement.url;}}// End --></script>
</head>
<body>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()"
onMouseout="lowlightie5()" onClick="jumptoie5();">
<div class="menuitems" url="javascript:history.back();">返回</div>
<div class="menuitems" url="http://javacool.3322.net">回首页</div>
<hr>
<div class="menuitems" url="http://www.163.com">网易</div>
<div class="menuitems" url="http://www.sohu.com">搜狐</div>
<hr>
<div class="menuitems" url="http://www.sina.com.cn">新浪</div>
<div class="menuitems" url="http://www.yahoo.com.cn">雅虎</div>
</div>
</body>
</html>
<script language="JavaScript1.2">
if (document.all && window.print) {
ie5menu.className = menuskin;
document.oncontextmenu = showmenuie5;
document.body.onclick = hidemenuie5;
}
</script>
http://www.blogcn.com/user20/boydreaming/index.html
http://www.cnky.net/forum/dispbbs.asp?boardID=420&ID=141013
http://www.xydi.com/design/web/200505/1744.html
http://www.id666.com/js/showjs.asp?js_id=390
http://www.pconline.com.cn/pcedu/empolder/wz/javascript/10202/37254.html
http://www.blueidea.com/bbs/newsdetail.asp?id=1491981&page=1&posts=&Daysprune=&lp=1
http://csdn.eyeah.cn/3116/1119/1136/265446414.html