Search in forum:
Search


Author Message
Post09/29/2008 at 2:36pm (UTC)    
Post subject: own right click menu

when you click mouse right button any where on browser
you get browser menu but with this code you replace it with your
own menu and options.
sure you can change the links with yours through the code
=for more info and to see an examlpe :
http://www.mymahdi.page.tl/JS-menus.htm
here is the code
Code:

<style>
<!--


.skin0{
position:absolute;
width:200px;
border:2px solid black;
background-color:menu;
font-family:Verdana;
line-height:20px;
cursor:default;
visibility:hidden;
}

.skin1{
cursor: default;
font: menutext;
position: absolute;
width: 165px;
background-color: menu;
border: 1 solid buttonface;
visibility:hidden;
border: 2 outset buttonhighlight;
}

.menuitems{
padding-left:15px;
padding-right:10px;
}
-->
</style>

<script language="JavaScript1.2">
//set the skin of the menu (0 or 1, with 1 rendering a default Windows menu like skin)
var menuskin=1

//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


function showmenuie5(){
//Find out how close the mouse is to the corner of the window
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<ie5menu.offsetWidth)
//move the horizontal position of the menu to the left by it's width
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
ie5menu.style.left=document.body.scrollLeft+event.clientX

//same concept with the vertical position
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==1)
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
}
}
</script>
<!--[if IE]>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="http://www.own-free-website.com">OFW main page</div>
<div class="menuitems" url="http://www.own-free-website.com/forum/" target="newwin">OFW Forum</div>
<div class="menuitems" url="http://www.yahoo.com">YAHOO</div>
<div class="menuitems" url="http://www.GOOGLE.com">GOOGLE</div>
<div class="menuitems" url="http://www.mymahdi.page.tl/HTML-Library-.htm">HTML Library</div>
<div class="menuitems" url="http://www.mymahdi.page.tl">MyMahdi</div>
<hr>
<div class="menuitems" url="mailto:mahdisam1120@yahoo.com">CONTACT US</div>
</div>
<![endif]-->
<script language="JavaScript1.2">
if (document.all&&window.print){
if (menuskin==0)
ie5menu.className="skin0"
else
ie5menu.className="skin1"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
</script>

best wishes Razz
______________
Post09/29/2008 at 2:45pm (UTC)    
Post subject:

where should i paste this code? in right box?
Post09/29/2008 at 2:56pm (UTC)    
Post subject:

if u like to see this menu in all your web pages use right box .
if you like to see it in one page just paste the code in the page source mode box...
sure after editing the code with your links
best wishes Razz
______________
Post09/29/2008 at 10:01pm (UTC)    
Post subject:

It is a great code Razz
Thanks Razz
______________
- If you love your own-free-website, fight against to spams and spammers! Please support us, let's remove all the spammers together! We don't want to see spams and spammers on OFW board!

- The only language of the board is English / Englisch / Anglaise / Inglés / Inglese / İngilizce / Angielski / Английский / Αγγλικά / 英语 / 英语简体英文. So please write in just English!

Own-free-website.com

Post10/03/2008 at 7:02am (UTC)    
Post subject:

is there any code to disable the right click menu on our website?
______________
Post10/03/2008 at 7:56am (UTC)    
Post subject:

Manage extras-->Add extra-->Small Extras-->Right click block !
Wink
______________




Post10/03/2008 at 8:01am (UTC)    
Post subject: Re: own right click menu

mymahdi wrote:
when you click mouse right button any where on browser
you get browser menu but with this code you replace it with your
own menu and options.
sure you can change the links with yours through the code
=for more info and to see an examlpe :
http://www.mymahdi.page.tl/JS-menus.htm
here is the code
Code:

<style>
<!--


.skin0{
position:absolute;
width:200px;
border:2px solid black;
background-color:menu;
font-family:Verdana;
line-height:20px;
cursor:default;
visibility:hidden;
}

.skin1{
cursor: default;
font: menutext;
position: absolute;
width: 165px;
background-color: menu;
border: 1 solid buttonface;
visibility:hidden;
border: 2 outset buttonhighlight;
}

.menuitems{
padding-left:15px;
padding-right:10px;
}
-->
</style>

<script language="JavaScript1.2">
//set the skin of the menu (0 or 1, with 1 rendering a default Windows menu like skin)
var menuskin=1

//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


function showmenuie5(){
//Find out how close the mouse is to the corner of the window
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<ie5menu.offsetWidth)
//move the horizontal position of the menu to the left by it's width
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
ie5menu.style.left=document.body.scrollLeft+event.clientX

//same concept with the vertical position
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==1)
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
}
}
</script>
<!--[if IE]>
<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">
<div class="menuitems" url="http://www.own-free-website.com">OFW main page</div>
<div class="menuitems" url="http://www.own-free-website.com/forum/" target="newwin">OFW Forum</div>
<div class="menuitems" url="http://www.yahoo.com">YAHOO</div>
<div class="menuitems" url="http://www.GOOGLE.com">GOOGLE</div>
<div class="menuitems" url="http://www.mymahdi.page.tl/HTML-Library-.htm">HTML Library</div>
<div class="menuitems" url="http://www.mymahdi.page.tl">MyMahdi</div>
<hr>
<div class="menuitems" url="mailto:mahdisam1120@yahoo.com">CONTACT US</div>
</div>
<![endif]-->
<script language="JavaScript1.2">
if (document.all&&window.print){
if (menuskin==0)
ie5menu.className="skin0"
else
ie5menu.className="skin1"
document.oncontextmenu=showmenuie5
document.body.onclick=hidemenuie5
}
</script>

best wishes Razz


actually i'm not really understand what is this code used for?
cuz i try to put this code at text top but there is nothing happen..
may somebody give me the detail explaination about this code? Very Happy
______________
Post02/08/2009 at 5:50am (UTC)    
Post subject:

just visit
http://www.mymahdi.page.tl/JS-menus.htm
u'll understand it when u use right click on that page
best wishes Very Happy
______________
Display posts from previous:   


Powered by phpBB © 2001, 2005 phpBB Group