最新更新 sitemap 设计搜素
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
网上家居 虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442

打造超酷网页右键菜单二法

日期:11-11    来源:pconline|    作者:


< SCRIPT LANGUAGE="JavaScript1.2">
  < !-- Web Site: http://www.painting-effects.co.uk -->

  < !-- This script and many more are available free online at -->
  < !-- The JavaScript Source!! http://javascript.internet.com -->

  < !-- Begin
  var menuskin = "skin1"; // skin0, or skin1
  var 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;
  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";
  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"));
  else
  window.location = event.srcElement.url;
   }
  }
  // End -->
  < /script>
  < 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>
  < script language="JavaScript1.2">
  if (document.all && window.print) {
  ie5menu.className = menuskin;
  document.oncontextmenu = showmenuie5;
  document.body.onclick = hidemenuie5;
  }
  < /script>

  其效果如下图: