PDA

View Full Version : RE: Pop-it Menu...



Big Bat
05-25-2014, 02:33 AM
I have used Pop-it Menu for many, many years and was wondering since I read somewhere recently that document.all is obsolete, deprecated, & will soon no longer be supported(at all) and since document.layers is in practically the same state/situation, perhaps the author of Pop-it Menu would consider updating the script to eliminate such things as: var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1,
var ns6=document.getElementById&&!document.all, and var ns4=document.layers. Surely no one still uses such old browsers(Netscape died with version 9.0.0.6). The reason I ask if the author would update this script is because I have never found another "popup-on-mouseover" that I would even consider. Please won't you update it to modern browser standards? Please?

vwphillips
05-25-2014, 02:52 PM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<style type="text/css">

#popitmenu{
position: absolute;
background-color: white;
border:1px solid black;
font: normal 12px Verdana;
line-height: 18px;
z-index: 100;
visibility: hidden;
}

#popitmenu a{
text-decoration: none;
padding-left: 6px;
color: black;
display: block;
}

#popitmenu a:hover{ /*hover background color*/
background-color: #CCFF9D;
}

</style>

<script type="text/javascript">

/***********************************************
* Pop-it menu- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified 25-May-2014
***********************************************/

var defaultMenuWidth="150px" //set default menu width.

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<a href="http://dynamicdrive.com">Dynamic Drive</a>'
linkset[0]+='<hr>' //Optional Separator
linkset[0]+='<a href="http://www.javascriptkit.com">JavaScript Kit</a>'
linkset[0]+='<a href="http://www.codingforums.com">Coding Forums</a>'
linkset[0]+='<a href="http://www.cssdrive.com">CSS Drive</a>'
linkset[0]+='<a href="http://freewarejava.com">Freewarejava</a>'

linkset[1]='<a href="http://msnbc.com">MSNBC</a>'
linkset[1]+='<a href="http://cnn.com">CNN</a>'
linkset[1]+='<a href="http://news.bbc.co.uk">BBC News</a>'
linkset[1]+='<a href="http://www.washingtonpost.com">Washington Post</a>'

////No need to edit beyond here



function showmenu(e, which, optWidth){
var o=showmenu.pop,s=window.innerHeight?[window.pageXOffset,window.pageYOffset]:document.documentElement.clientHeight?[document.documentElement.scrollLeft,document.documentElement.scrollTop]:[document.body.scrollLeft,document.body.scrollTop],xy=window.event?[e.clientX+s[0],e.clientY+s[1]]:[e.pageX,e.pageY];
if (!o){
o=showmenu.pop={};
o.p=document.createElement('DIV');
o.p.id='popitmenu';
document.body.appendChild(o.p);
o.p.onmouseover=clearhidemenu;
o.p.onmouseout=delayhidemenu;
o.m=document.createElement('DIV');
o.m.style.position='fixed';
o.m.style.right=o.m.style.bottom=o.m.style.width=o.m.style.height='0px';
document.body.appendChild(o.m);
}
if (o){
clearhidemenu();
o.p.innerHTML=which;
o.p.style.width=(typeof optWidth!='undefined')?optWidth:defaultMenuWidth;
o.p.style.left=Math.min(xy[0],o.m.offsetLeft-o.p.offsetWidth+s[0])+'px';
o.p.style.top=Math.min(xy[1],o.m.offsetTop-o.p.offsetHeight+s[1])+'px';
o.p.style.visibility='visible';
}
return false
}

function hidemenu(){
var o=showmenu.pop;
o?o.p.style.visibility='hidden':null;
}

function delayhidemenu(){
var o=showmenu.pop;
o?o.to=setTimeout(function(){ hidemenu(); },500):null;
}

function clearhidemenu(){
var o=showmenu.pop;
o?clearTimeout(o.to):null;
}


</script>

</head>

<body>
<a href="#" onMouseover="showmenu(event,linkset[0])" onMouseout="delayhidemenu()">Webmaster Links</a><br>
<a href="#" onMouseover="showmenu(event,linkset[1], '180px')" onMouseout="delayhidemenu()">News sites</a></body>

</html>

Big Bat
05-25-2014, 06:54 PM
Well, that was certainly a quick reply. Thank you, thank you, thank you.