Step1:
首先请在之间粘贴右边的两个CSS:
#superball {
position:absolute;
left:0;
top:0;
visibility:hide;
visibility:hidden;
width:40;
height:40;
}
Step2:
然后在之间粘贴右边的Script代码:
var ballWidth = 40;
var ballHeight = 40;
var BallSpeed = 4;
var maxBallSpeed = 50;
var xMax;
var yMax;
var xPos = 0;
var yPos = 0;
var xDir = ''right'';
var yDir = ''down'';
var superballRunning = true;
var tempBallSpeed;
var currentBallSrc;
var newXDir;
var newYDir;
function initializeBall() {
if (document.all) {
xMax = document.body.clientWidth
yMax = document.body.clientHeight
document.all("superball" .style.visibility = "visible";
}
else if (document.layers||document.getElementById) {
xMax = window.innerWidth-14;
yMax = window.innerHeight;
if (document.getElementById)
document.getElementById("superball".style.visibility="visible"
else
document.layers["superball"].visibility = "show";
}
setTimeout(''moveBall()'',400);
}
function moveBall() {
if (superballRunning == true) {
calculatePosition();
if (document.all) {
document.all("superball".style.left = xPos + document.body.scrollLeft;
document.all("superball".style.top = yPos + document.body.scrollTop;
}
else if (document.layers) {
document.layers["superball"].left = xPos + pageXOffset;
document.layers["superball"].top = yPos + pageYOffset;
}
else if (document.getElementById) {
document.getElementById("superball".style.left = xPos + pageXOffset;
document.getElementById("superball".style.top = yPos + pageYOffset;
}
setTimeout(''moveBall()'',30);
}
}
function calculatePosition() {
if (xDir == "right" {
if (xPos > (xMax - ballWidth - BallSpeed)) {
xDir = "left";
}
}
else if (xDir == "left" {
if (xPos (yMax - ballHeight - BallSpeed)) {
yDir = "up";
}
}
else if (yDir == "up" {
if (yPos
Step3:
请继续在之间粘贴右边的层:
PS:附加说明:1.请自行制作一个适合你自己的图片,如本处所使用的"superball.gif",如果你的图片尺寸有所改变请查找第一步和第二步中代码的width和height的值进行修改
2.将第三步中的换成你的链接即可
然后在之间粘贴右边的代码;这就是右键菜单,共有7个层,您可以修改这7个层的内容已适应您的站点:
Step3:
请继续在之间粘贴右边的JS代码;这个代码就是实现这个特效的主要JS:
dim down,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree
down=false
timelinestart=0
timelinestop=0
sub document_onmousedown
if window.event.button=2 then
plane.style.display=""
plane.style.left=window.event.clientx-153
plane.style.top=window.event.clienty-35
end if
end sub
sub document_ondargstart
window.event.returnvalue=false
end sub
function menuin()
cleartimeout(tidtree)
end function
sub document_onclick
tidtree=settimeout("outit()",200)
end sub
function init()
if timelinestart5 then
cleartimeout(tidtwo)
item1.style.pixelLeft=item1.style.pixelLeft+20
item1.filters.alpha.opacity=item1.filters.alpha.opacity+20
item2.style.pixelLeft=item2.style.pixelLeft-20
item2.filters.alpha.opacity=item2.filters.alpha.opacity+20
item3.style.pixelLeft=item3.style.pixelLeft+20
item3.filters.alpha.opacity=item3.filters.alpha.opacity+20
item4.style.pixelLeft=item4.style.pixelLeft-20
item4.filters.alpha.opacity=item4.filters.alpha.opacity+20
item5.style.pixelLeft=item5.style.pixelLeft+20
item5.filters.alpha.opacity=item5.filters.alpha.opacity+20
item6.style.pixelLeft=item6.style.pixelLeft-20
item6.filters.alpha.opacity=item5.filters.alpha.opacity+20
item7.style.pixelLeft=item7.style.pixelLeft+20
item7.filters.alpha.opacity=item7.filters.alpha.opacity+20
timelinestart=timelinestart+1
else
cleartimeout(tidone)
end if
tidone=settimeout("init()",1)
end function
function outit()
if timelinestart0 then
cleartimeout(tidone)
item1.style.pixelLeft=item1.style.pixelLeft-20
item1.filters.alpha.opacity=item1.filters.alpha.opacity-20
item2.style.pixelLeft=item2.style.pixelLeft+20
item2.filters.alpha.opacity=item2.filters.alpha.opacity-20
item3.style.pixelLeft=item3.style.pixelLeft-20
item3.filters.alpha.opacity=item3.filters.alpha.opacity-20
item4.style.pixelLeft=item4.style.pixelLeft+20
item4.filters.alpha.opacity=item4.filters.alpha.opacity-20
item5.style.pixelLeft=item5.style.pixelLeft-20
item5.filters.alpha.opacity=item5.filters.alpha.opacity-20
item6.style.pixelLeft=item6.style.pixelLeft+20
item6.filters.alpha.opacity=item6.filters.alpha.opacity-20
item7.style.pixelLeft=item7.style.pixelLeft-20
item7.filters.alpha.opacity=item7.filters.alpha.opacity-20
timelinestart=timelinestart-1
else
cleartimeout(tidtwo)
plane.style.display="none"
exit function
end if
tidtwo=settimeout("outit()",1)
end function
Step4:
请继续在标签里面加上右边的代码:
oncontextmenu="return false"
效果预览:http://0755i.com/js/menu/rightmenu/preview.htm
PS:附加说明: step4是用来屏蔽IE本身的右键菜单的,不要忘了加上 !
给你的图片加上动态的光照效果推荐!
Step1:
首先请在CSS样式表中增加右边的CSS:
#spotlight{filter:light}
Step2:
然后在之间粘贴右边的script代码;
if (document.all&&window.spotlight){
var x=new Array()
var direction=new Array()
var y=new Array()
if (spotlight.length==null){
spotlight[0]=document.all.spotlight
x[0]=0
direction[0]="right"
y[0]=spotlight[0].height
spotlight[0].filters.light.addPoint(100,50,100,255,255,255,90)
}
else
for (i=0;i<spotlight.length;i++){
x[i]=0
direction[i]="right"
y[i]=spotlight[i].height
spotlight[i].filters.light.addPoint(100,50,100,255,255,255,90)
}
}
function slidelight(cur){
spotlight[cur].filters.light.MoveLight(0,x[cur],y[cur],200,-1)
if (x[cur]spotlight[cur].width+200){
direction[cur]="left"
x[cur]-=10
}
else if (x[cur]>-200&&x[cur]<-185){
direction[cur]="right"
x[cur]+=10
}
else{
x[cur]-=10
direction[cur]="left"
}
}
if (document.all&&window.spotlight){
if (spotlight.length==null)
setInterval("slidelight(0)",spotlight[0].speed)
else
for (t=0;t<spotlight.length;t++){
var temp=''setInterval("slidelight(''+t+''
",''+spotlight[t].speed+''
''
eval(temp)
}
}
Step3:
在你要加特效的图片的标签里粘贴右边的代码;
id=spotlight speed="50"
PS:效果预览:http://0755i.com/js/image/light/preview.htm
再PS:附加说明: 1.图片的代码示例:
2.另外,Script代码一定要放在所有你要加的图片的标签之后!!!
3.修改speed="50" 调节速度,数值越小,速度越快
注意啦!
PPPPPPSSSSSNND.有的地方乱码了.不过不要紧.把有笑脸的地方用右半个括号来代替就好了.就是说把代码中的笑脸全用半个括号代替!见鬼的博客中国!竟给大家找麻烦!


