Menu Creator

[Total: 0    Average: 0/5]

This script creates the popup menu code for your links.

Head Code:

<SCRIPT language=JavaScript><!--
function RAZVar(){}
function raz(){
NBuser = 0;
liensaff = "";
document.ParaForm.reset();
document.ScriptForm.reset();
}

NBuser = 0;
liensaff = "";
function recordUser(type)
{
if (type==""){
liensaff += '<div class="menuitems" url="' + document.ParaForm.url.value + '">' + document.ParaForm.texte.value + '</div>n';
document.ParaForm.exemple.value += document.ParaForm.texte.value+"n";
NBuser++;
if (NBuser <10)	{
	NBuserimg = "0" + NBuser;
} else {
	NBuserimg = "" + NBuser;
}
}
if(type == "hr"){
liensaff += '<HR>n';
document.ParaForm.exemple.value += "-------------------n";
}
document.ParaForm.url.value = "";
document.ParaForm.texte.value = "";
document.ParaForm.texte.focus();
}

function editCode(){
RAZVar()
headtxt = "<!-- Beginning -->n";
bodytxt = "<!-- Beginning -->n";

headtxt += '<style>n.skin0{position:absolute; width:200px; border:2px solid black; background-color:menu; font-family:Verdana; line-height:20px; cursor:default; visibility:hidden; }n.skin1{cursor: default; font: menutext; position: absolute; width: 145px; background-color: menu;  border: 1 solid buttonface;visibility:hidden; border: 2 outset buttonhighlight; font-family: Verdana,Geneva, Arial; font-size: 10px; color: black;}n.menuitems{padding-left:15px; padding-right:10px; }n</style>';
headtxt += '<script language="JavaScript1.2">nvar menuskin=1nvar display_url=0nnfunction showmenuie5(){nvar rightedge=document.body.clientWidth-event.clientXnvar bottomedge=document.body.clientHeight-event.clientYnnif (rightedge<ie5menu.offsetWidth)nie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidthnelsenie5menu.style.left=document.body.scrollLeft+event.clientXnif (bottomedge<ie5menu.offsetHeight)nie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeightnelsenie5menu.style.top=document.body.scrollTop+event.clientYnnie5menu.style.visibility="visible"nreturn falsen}nn';
headtxt += 'function hidemenuie5(){nie5menu.style.visibility="hidden"n}nnfunction highlightie5(){if (event.srcElement.className=="menuitems"){nevent.srcElement.style.backgroundColor="highlight"nevent.srcElement.style.color="white"nif (display_url==1)nwindow.status=event.srcElement.urln}n}nnfunction lowlightie5(){nif (event.srcElement.className=="menuitems"){nevent.srcElement.style.backgroundColor=""nevent.srcElement.style.color="black"nwindow.status=''n}n}nn';
headtxt += 'function jumptoie5(){nif (event.srcElement.className=="menuitems"){nif (event.srcElement.getAttribute("target")!=null)nwindow.open(event.srcElement.url,event.srcElement.getAttribute("target"))nelsenwindow.location=event.srcElement.urln}n}n</script>';

bodytxt += '<div id="ie5menu" class="skin0" onMouseover="highlightie5()" onMouseout="lowlightie5()" onClick="jumptoie5()">n<div class="menuitems" url="javascript:history.go(-1)">Back</div>n<div class="menuitems" url="javascript:history.go(1)">Forward</div><hr><div class="menuitems" url="http://www.js-examples.com/">JavaScript</div><hr>n';
bodytxt += liensaff+"</DIV>";
bodytxt += '<script language="JavaScript1.2">nif (document.all&&window.print){nif (menuskin==0)nie5menu.className="skin0"nelsenie5menu.className="skin1"ndocument.oncontextmenu=showmenuie5ndocument.body.onclick=hidemenuie5 } n</script>';
headtxt += "n<!-- End -->";
bodytxt += "n<!-- End -->";
document.ScriptForm.head.value = headtxt;
document.ScriptForm.body.value = bodytxt;
}
//--></SCRIPT>
<!-- Beginning -->
<STYLE>.skin0 {
	BORDER-RIGHT: black 2px solid; BORDER-TOP: black 2px solid; VISIBILITY: hidden; BORDER-LEFT: black 2px solid; WIDTH: 200px; CURSOR: default; LINE-HEIGHT: 20px; BORDER-BOTTOM: black 2px solid; FONT-FAMILY: Tahoma,"ms sans serif",Verdana; POSITION: absolute; BACKGROUND-COLOR: menu
}
.skin1 {
	BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; FONT-SIZE: 10px; VISIBILITY: hidden; BORDER-LEFT: buttonhighlight 2px outset; WIDTH: 145px; CURSOR: default; COLOR: black; BORDER-BOTTOM: buttonhighlight 2px outset; FONT-FAMILY: Tahoma,"ms sans serif",Verdana,Geneva, Arial; POSITION: absolute; BACKGROUND-COLOR: menu
}
.menuitems {
	PADDING-RIGHT: 10px; PADDING-LEFT: 15px
}
</STYLE>

<SCRIPT language=JavaScript1.2><!--
var menuskin=1
var display_url=0

function showmenuie5(){
var rightedge=document.body.clientWidth-event.clientX
var bottomedge=document.body.clientHeight-event.clientY

if (rightedge<ie5menu.offsetWidth)
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
else
ie5menu.style.left=document.body.scrollLeft+event.clientX
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>

Body Code:

<DIV class=skin0 id=ie5menu onmouseover=highlightie5() onclick=jumptoie5() 
onmouseout=lowlightie5()>
<DIV class=menuitems url="javascript:history.go(-1)">Back</DIV>
<DIV class=menuitems url="javascript:history.go(1)">Forward</DIV>
<HR>

<DIV class=menuitems url="http://www.js-examples.com/">Home
</DIV>
<HR>

<DIV class=menuitems 
url="http://www.js-examples.com/asp/">ASP</DIV>
<HR>


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

                        <TABLE cellSpacing=0 cellPadding=2 width="100%" 
                        bgColor=#0033cc border=7>
                          <TBODY>
                          <TR>
                            <TD align=middle width="100%"><SMALL><B><FONT 
                              color=#ffffff>Part no 1</FONT></B></SMALL></TD></TR>
                          <TR>
                            <TD 
                            style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" 
                            width="100%" bgColor=#ffffff><SMALL><B>Click right button to see a menu
                              <FORM name=ParaForm>
                              <TABLE cellSpacing=0 cellPadding=1 width=350 
                              align=center bgColor=#0033cc border=0>
                                <TBODY>
                                <TR>
                                <TD align=middle width="100%">
                                <TABLE cellSpacing=0 cellPadding=2 width="100%" 
                                bgColor=#0033cc border=0>
                                <TBODY>
                                <TR>
                                <TD align=middle width="100%"><SMALL><B><FONT 
                                color=#ffffff>Registration of lines 
                                :</FONT></B></SMALL></TD></TR>
                                <TR>
                                <TD 
                                style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" 
                                width="100%" bgColor=#ffffff>
                                <CENTER><SMALL><B><BR>Enter the name of link: 
                                <BR><INPUT size=40 name=texte><BR><BR>Enter 
                                URL of Your link (for example): <BR><FONT 
                                color=#0033cc>http://www.js-examples.com/
				</FONT> or email <FONT 
                                color=#0033cc>mailto:noone@nowhere.com</FONT> : 
                                <BR><INPUT size=40 name=url><BR><BR><INPUT onclick="recordUser('')" type=button value="Add the item"><INPUT onclick="recordUser('hr')" type=button value="Add separator"><BR><BR></B></SMALL></CENTER></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

				<br>

                              <TABLE cellSpacing=0 cellPadding=1 width=350 
                              align=center bgColor=#0033cc border=0>
                                <TBODY>
                                <TR>
                                <TD width="100%">
                                <TABLE cellSpacing=0 cellPadding=2 width="100%" 
                                bgColor=#0033cc border=0>
                                <TBODY>
                                <TR>
                                <TD width="100%"><SMALL><B><FONT 
                                color=#ffffff>Items of menu :</FONT></B></SMALL></TD></TR>
                                <TR>
                                <TD 
                                style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" 
                                width="100%" bgColor=#ffffff><SMALL>
                                <CENTER><TEXTAREA style="WIDTH: 400px" name=exemple rows=15 wrap=physical cols=40>Back
Forward
-------------------
Javascript
-------------------
</TEXTAREA> 
                                </CENTER></SMALL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
                              <P>
                              <CENTER><INPUT onclick='editCode()' type=button value=" Get the code "> 
<INPUT onclick='raz()' type=button value=" Reset "></CENTER></FORM></B></SMALL></TD></TR></TBODY></TABLE>
                  <P><!---------- Part 2 ------------->
<center>
                  <TABLE cellSpacing=0 cellPadding=1 width=452 bgColor=#0033cc 
                  border=0>
                    <TBODY>
                    <TR>
                      <TD align=middle width="100%">


                        <TABLE cellSpacing=2 cellPadding=1 width="100%"   bgColor=#0033cc border=7>
                          <TBODY>
                          <TR>
                            <TD align=center width="100%"><SMALL><B><FONT 
                              color=#ffffff>Part no 2</FONT></B></SMALL></TD></TR>
                          <TR>
                            <TD 
                            style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px" 
                            width="100%" bgColor=#ffffff><SMALL>
                              <P>
                              <FORM name=ScriptForm action="" method=post>
                              <CENTER>Enter this code between
                              <B>&lt;HEAD&gt;</B> and <B>&lt;/HEAD&gt;</B>:<BR><TEXTAREA style="WIDTH: 400px" name=head rows=15 wrap=physical cols=40></TEXTAREA>
                              <P>Enter this code between <B>&lt;BODY&gt;</B> and 
                              <B>&lt;/BODY&gt;</B> tags<BR><TEXTAREA style="WIDTH: 400px" name=body rows=15 wrap=physical cols=40></TEXTAREA>
				</CENTER></FORM>
                              </SMALL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</center>
<BR>
See the menu? Right click....

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *