sama kaiia biasanya,
Basa basi dkit dlo..
klo g berguna ato repost,mod boleh hapus!
^_^
[b]Credit By :[/b]
http://www.dynamicdrive.com
langsung aja k pokok permasalahan!
klo biasa" nya cuma [b]disable right click[/b] ato [b]redirect[/b] ke url t'tntu...
ini beda,,!!

[url=http://h1.ripway.com/deesygs/preview.html]Live Preview[/url] (klo udah di right klick iia!!)

ScreenShoot:

[img]http://h1.ripway.com/deesygs/rm.jpg[/img]

Pertama:
Simpan file di bawah ini ke file CSS kamu :

[spoiler][quote]/* Right Click Menu */
.rm_face{
position:absolute;
width:[b]165[/b]px;
border: [b]0[/b]px solid [b]#000000[/b];
background-color:[b]#6DA4DB[/b];
font-family:Arial;
line-height:20px;
cursor:default;
font-size:14px;
font-weight:bold;
z-index:100;
visibility:hidden;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
opacity: 0.7;
}
.body_rm{
font-family:Arial;
color:[b]#ffffff[/b];
font-weight:bold;
padding-left:10px;
padding-right:10px;
}
.head_rm{
color:[b]#ffffff[/b];
line-height:30px;
font-family:Arial;
line-height:30px;
font-size:14px;
background-image:url('http://h1.ripway.com/deesygs/head.jpg');
font-weight:bold;
}
.scrapbook{display:none;background:transparent;}[/quote]
[/spoiler]
yg dee [b]tebelin[/b],bisa diganti sesuai selera!!

Kedua:
Simpan kode di bawah ini ke JS kamu di Bagian A:
[spoiler][quote]// Right Menu
var rightdee;
try {rightdee = document.createElement("div");}
catch (e) {rightdee = document.createElement("<div>");}
rightdee.innerHTML = "<div id='dee_rm' class='rm_face' onMouseover='rm_highlight(event)' onMouseout='rm_lowlight(event)' onClick='rm_jump(event)' display:none>"+
"<div class='head_rm' align='center'>[b]dEe's Menu[/b]</div>"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"[i]<hr>[/i]"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"<div class='body_rm' url='[b]URL[/b]' target='[i]newwin[/i]'>[b]Text[/b]</div>"+
"</div>";
rightdee.setAttribute("style","text-align:center;padding-top:10px");
document.getElementById("18").parentNode.appendChild(rightdee);[/quote]
[/spoiler]
edit yg dee [b]tebelin[/b]...

Keterangan bagian yg [i]miring[/i]
1.[i]newwin[/i] = fungsi nya seperti [b]_blank[/b]
2.[i]<hr>[/i] = fungsi nya sebagai separator

Ketiga:
Simpan kode di bawah ini ke JS kamu di Bagian C:
[spoiler][quote]// Right Click Menu
var display_url=0
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById("dee_rm")
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 rm_highlight(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="body_rm"||ns6&&firingobj.parentNode.className=="body_rm"){
if (ns6&&firingobj.parentNode.className=="body_rm") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor="[b]4A93DD[/b]" // hover bg color on body
firingobj.style.color="[b]white[/b]" // hover bg color on body
if (display_url==1)
window.status=event.srcElement.url
}
}
function rm_lowlight(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="body_rm"||ns6&&firingobj.parentNode.className=="body_rm"){
if (ns6&&firingobj.parentNode.className=="body_rm") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor="" // visited bg color on body
firingobj.style.color="[b]white[/b]" // visited color on body
window.status=''
}
}
function rm_jump(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="body_rm"||ns6&&firingobj.parentNode.className=="body_rm"){
if (ns6&&firingobj.parentNode.className=="body_rm") 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
}[/quote]
[/spoiler]
edit yg dee [b]tebelin[/b] sesuai selera!
^_^
smoga berguna!!


[img]http://theftalk.com/img/warn_add.gif[/img] 1 kalo lu suka!
Last edited by deeucul (2008-08-17 06:42:27)