教程 | 特别的锁右键 ( blogskin )
23 August 2012 @ 11:53 AM
给 Hippo 的教程
转帖请留言和附上链接 ♥
转帖请留言和附上链接 ♥


步骤一
Template - Edit html
步骤二
用 ctrl + f 找 :
</style>
步骤三
把代码放在 </style> 上面 :
.skin{
text-align: center;
width:200px;
padding:4px;
position:absolute;
border-radius:3px;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border:2px solid #000000;
color: #000000;
background-color: #ffffff;
z-index:1;
visibility:hidden;
}
红色的 是框框的宽度 .
蓝色的 是框框和字的距离 .
紫色的 是框框的圆角度 .
三个都必须一样 .
黄色的 是框框的粗细度 .
橙色 highlight 的 是框框的种类 .
黄色 highlight 的 是框框的颜色 .
蓝色 highlight 的 是字体的颜色 .
紫色 highlight 的 是背景的颜色 .
背景要放图片的代码 :
background:url(背景图片网址);
改变字体的代码 :
font-family:字体名称;
框框影子的代码 :
box-shadow:0 0 10px #影子的颜色代码;
字体影子的代码 请参考这篇 .
步骤四
用 ctrl + f 找 :
<body>
步骤五
把代码放在 <body> 下面 :
<div id="ie5menu" class="skin" onmouseover="highlightie5(event)" onmouseout="lowlightie5(event)" onclick="jumptoie5(event)" display:none>
<div>Please use ctrl + f to copy codes</div>
<div>(: </div></div>
<script language="JavaScript1.2">
//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=0
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById("ie5menu")
function showmenuie5(e){
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX
//same concept with the vertical position
if (bottomedge<menuobj.offsetHeight)
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
else
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY
menuobj.style.visibility="visible"
return false
}
function hidemenuie5(e){
menuobj.style.visibility="hidden"
}
function highlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor="highlight"
firingobj.style.color="E6E4E5"
if (display_url==1)
window.status=event.srcElement.url
}
}
function lowlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor=""
firingobj.style.color="826A92"
window.status=''
}
}
function jumptoie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(firingobj.getAttribute("url"),firingobj.getAttribute("target"))
else
window.location=firingobj.getAttribute("url")
}
}
if (ie5||ns6){
menuobj.style.display=''
document.oncontextmenu=showmenuie5
document.onclick=hidemenuie5
}
</script>
灰色 highlight 的 是你要写的字 .
备注 : 不要写那么多字哦 , 不然会很乱 /.\
代码转自 : Choco

在评论箱留言请告诉我 (:
版权所有 翻印必究. ♥