PDA

View Full Version : right click!!!



308holes
September 5th, 2001, 18:43
is their a way to change the background and text color of the right click menu?

meow
September 5th, 2001, 18:55
Right click desktop | Properties | Appearance | Color Scheme
:p

Mekhu
September 5th, 2001, 19:22
Just headover to like dynamicdrive.com or javascript.com and grab one of their premade scripts and then change it up!

Mekhu

308holes
September 5th, 2001, 21:06
Originally posted by meow
Right click desktop | Properties | Appearance | Color Scheme
:p
i know how to do that one i ment on my webpage

Mekhu
September 5th, 2001, 21:38
Paste the script below just under the opening body tag of your html document:



<script language="JavaScript1.2">

var isie=0;
if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVe rsion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
isie=1;
}
else {
isie=0;
}
if(isie) {
var html="";
html+='<TABLE STYLE="border:1pt solid #808080" BGCOLOR="#CCCCCC" WIDTH="140" HEIGHT="220" CELLPADDING="0" CELLSPACING="1">';
html+='<ST'+'YLE TYPE="text/css">\n';
html+='a:link {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
html+='a:visited {text-decoration:none;font-family:Arial;font-size:8pt;}\n';
html+='td {font-size:8pt;}\n';
html+='</ST'+'YLE>\n';
html+='<SC'+'RIPT LANGUAGE="JavaScript">\n';
html+='\n<'+'!--\n';
html+='window.onerror=null;\n';
html+='/'+' -'+'->\n';
html+='</'+'SCRIPT>\n';
html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i0" ONMOUSEOVER="document.all.i0.style.background=\'#CFD6E8\';document.all.i0 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i0.style.background=\'#CCCCCC\';document.all.i0 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.history.go(-1);">&nbsp;&nbsp;Back</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i1" ONMOUSEOVER="document.all.i1.style.background=\'#CFD6E8\';document.all.i1 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i1.style.background=\'#CCCCCC\';document.all.i1 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.history.go(1);">&nbsp;&nbsp;Forward</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"><IMG SRC="pixel.gif" WIDTH="130" HEIGHT="1"></TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i4" ONMOUSEOVER="document.all.i4.style.background=\'#CFD6E8\';document.all.i4 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i4.style.background=\'#CCCCCC\';document.all.i4 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.external.AddFavorite(window.top.location.href, window.top.document.title);">&nbsp;&nbsp;Add to Favorites...</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i5" ONMOUSEOVER="document.all.i5.style.background=\'#CFD6E8\';document.all.i5 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i5.style.background=\'#CCCCCC\';document.all.i5 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.location=\'view-source:\'+window.parent.location.href;">&nbsp;&nbsp;View Source</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"><IMG SRC="pixel.gif" WIDTH="130" HEIGHT="1"></TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i6" ONMOUSEOVER="document.all.i6.style.background=\'#CFD6E8\';document.all.i6 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i6.style.background=\'#CCCCCC\';document.all.i6 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.print();">&nbsp;&nbsp;Print</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i7" ONMOUSEOVER="document.all.i7.style.background=\'#CFD6E8\';document.all.i7 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i7.style.background=\'#CCCCCC\';document.all.i7 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="window.parent.location.href=window.parent.location.href;">&nbsp;&nbsp;Refresh</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC"><IMG SRC="pixel.gif" WIDTH="130" HEIGHT="1"></TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i8" ONMOUSEOVER="document.all.i8.style.background=\'#CFD6E8\';document.all.i8 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i8.style.background=\'#CCCCCC\';document.all.i8 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=1.6; else window.parent.document.body.style.zoom=1.6;">&nbsp;&nbsp;Zoom In</TD></TR>';

html+='<TR><TD STYLE="border:1pt solid #CCCCCC" ID="i9" ONMOUSEOVER="document.all.i9.style.background=\'#CFD6E8\';document.all.i9 .style.border=\'1pt solid #737B92\';" ONMOUSEOUT="document.all.i9.style.background=\'#CCCCCC\';document.all.i9 .style.border=\'1pt solid #CCCCCC\';" ONCLICK="if(window.parent.document.body.style.zoom!=0) window.parent.document.body.style.zoom*=0.625; else window.parent.document.body.style.zoom=0.625;">&nbsp;&nbsp;Zoom Out</TD></TR>';

html+='</TABLE>';

var oPopup = window.createPopup();

}

function dopopup(x,y) {
if(isie) {
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML = html;
oPopup.show(x, y, 140, 220, document.body);
}
}

function click(e) {
if(isie) {
if(document.all) {
if(event.button==2||event.button==3) {
dopopup(event.x-1,event.y-1);
}
}
}
}

if(isie) {
document.oncontextmenu = function() { dopopup(event.x,event.y);return false; }
document.onmousedown = click;
}
// -->
</script>




Thanks,

Mekhu

meow
September 5th, 2001, 22:02
Just 2 problems.
1. It doesn't change the color of context meny. It creates a lookalike.
2. It doesn't work. :D
You must have missed some part of the code.

Mekhu
September 5th, 2001, 22:23
don't know then :biggrin2:

meow
September 5th, 2001, 22:42
:jump:

Mekhu
September 6th, 2001, 01:55
http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm

this may help...

308holes
September 6th, 2001, 03:45
that works great THANKS A LOT:chinese2:

LeX
September 6th, 2001, 09:34
Why do you people complicate things so much? A lot of that JavaScript stuff was completely uncecessary...

meow
September 6th, 2001, 09:44
You also need to rememer that a JavaScript pop-up isn't the context menu. I have about 10 items on it that you don't now what they are and I get PISSED if someone takes them away from me. ogre2 ;)

LeX
September 6th, 2001, 10:11
Originally posted by meow
You also need to rememer that a JavaScript pop-up isn't the context menu. I have about 10 items on it that you don't now what they are and I get PISSED if someone takes them away from me. ogre2 ;)
Uhh..... who are you talking to? :confused:

meow
September 6th, 2001, 10:24
The ones that use that script of course. You senile? :rolleyes:

308holes
September 6th, 2001, 18:33
ok one more thing is thier a javaScript code for copy and past??? i have looked in my book and found nothing ?

308holes
September 7th, 2001, 04:08
please

LeX
September 7th, 2001, 08:31
http://www.dynamicdrive.com/dynamicindex11/copytext.htm

308holes
September 7th, 2001, 15:23
ok that wont work on my right click menu ?:confused2

LeX
September 8th, 2001, 09:46
Modify it then.

MaGiCSuN
September 8th, 2001, 09:49
sometimes people are too easy.......... :rolleyes:

308holes
September 8th, 2001, 14:49
im not a JavaScript pro man i have only been doing it for like 3 weeks lol

meow
September 8th, 2001, 16:25
:) Can you tell us exactly what you want to do? If you want to change the color of the context menu as you first said, I don't think it can be done. Possibly with some proprietary MS CSS the same way as for the scroll bars, but I don't think such a creature exists.

If you want a JavaScript pop-up that looks like the context menu that is a totally different thing.

308holes
September 8th, 2001, 20:43
ive got the rightclick menu dune but i want to add a copy and past to the right click menu so i want the menu to have
go back
go forward
copy
paste
<hr>
forum
contact
i have dune all but the copy and paste can some one help me

Canuckkev
September 8th, 2001, 22:11
I doubt any java script will have the security clearance to modify your clipboard in any way. Maybe using some script to send the copied text to a variable, then when the paste command is used, dump the contents of the variable. You will have to pass the string to the other pages though if you need to copy and paste from other pages. This will only work for copying and pasting text from pages in your browser with the proper scripting on it though. I have no idea what I just said so I hope someone else does.

308holes
September 9th, 2001, 04:11
WHAT!!,
So their is no JavaScript or any code that will act like the right click menu's copy/paste button?

LeX
September 9th, 2001, 07:54
Originally posted by 308holes
im not a JavaScript pro man i have only been doing it for like 3 weeks lol I have never learned JavaScript either... but it doesn't take a professional JavaScripter to modify a code to suit one's needs. Anyone can do that if they actually tried.

Just study some scripts and see how things work and try to modify the script based on what you learned from your "research". It's worked 90% of the time for me... if your script still doesn't function properly after numerous tries, then post your script here and ask for help. Anyway, that's what I do.

308holes
September 9th, 2001, 13:19
I have to have a code first to be able to modify it !!!

LeX
September 10th, 2001, 08:16
Originally posted by Mekhu
http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm

308holes
September 10th, 2001, 12:13
"I allready have a right click menu!"
What im looking for now is a script that will let me "ADD" copy and paste as a selection in the menu anyone know how or where i can find it???

LeX
September 11th, 2001, 10:01
Oh... well, in that case, just ask your visitors to CTRL + C. :p

308holes
September 12th, 2001, 03:32
any way to have JavaScript to fake like ctrl+c was pressed ?