PDA

View Full Version : AnyLink Drop Down Menu block popups ??



minnie
06-24-2006, 09:55 PM
Hi
i'm having a problem with anylink dropdown menu , when i click on a link the popupblocker(google) blocks the link.
the <base target=_blank> code is on top of all my pages , that could be the problem.
the links have to open in a new window , is it possible with any link dropdown menu ?? :confused:
i think almost 80% of the surfers are using popup blockers , so they never see my links :(

djr33
06-25-2006, 01:05 AM
I'm not sure specifically, but it sounds a bit weird to me.
The thing is... popup blockers usually only block those popups autogenerated by the page, not those when a user clicks.
in other words:
onLoad = blocked.
onClick = ok.


So... you might want to find a way to make it clear to the popup blocker that it was user-initiated.

By the way, there won't be any other way around the popup blockers... that's their job, and they do it well.

jscheuer1
06-25-2006, 04:15 AM
Hi
i'm having a problem with anylink dropdown menu , when i click on a link the popupblocker(google) blocks the link.
the <base target=_blank> code is on top of all my pages , that could be the problem.
the links have to open in a new window , is it possible with any link dropdown menu ?? :confused:
i think almost 80% of the surfers are using popup blockers , so they never see my links :(

Do you mean Google hosts your site? If so, the general rules may not apply. This has been found to be true on Geocities and I am sure some other hosts have scripts that change the rules. Give us a link to the site.

minnie
06-25-2006, 08:13 AM
here is the code
when i click on a link in the menu google toolbar blocks the links


<html>
<head>
<title>Toolbar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<base target="_blank">
<style type="text/css"><!--
TD {
FONT-SIZE: 11px; FONT-FAMILY: verdana
}
A {
FONT-SIZE: 11px; COLOR: #000000; TEXT-DECORATION: underline
}
A:hover {
COLOR: #000000; TEXT-DECORATION: underline
}
#dropmenudiv{
position:absolute;
border:1px solid #DDDDDD;
border-bottom-width: 0;
line-height:18px;
z-index:100;
}


#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
}

#dropmenudiv a:hover{ /*hover background color*/
background-color: #C1C1C1;
}


-->
</style>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" link="#000000" vlink="#000000" alink="#000000">
<font face="Arial, Helvetica, sans-serif"> </font> <font face="Arial, Helvetica, sans-serif">
</font> <font face="Arial, Helvetica, sans-serif"> </font> <font face="Arial, Helvetica, sans-serif">
<a href="default.htm" onClick="return clickreturnvalue()" onMouseOver="dropdownmenu(this, event, menu1, '170px')" onMouseOut="delayhidemenu()">menu</a><br>
<script type="text/javascript">

/***********************************************
* AnyLink Drop Down Menu- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var menu1=new Array()
menu1[0]='<a href="http://cnn.com">CNN</a>'
menu1[1]='<a href="http://msnbc.com">MSNBC</a>'
menu1[2]='<a href="http://news.bbc.co.uk">BBC News</a>'


var menuwidth='200px' //default menu width
var menubgcolor='#DDDDDD' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


</script>
</font>
</body>
</html>

jscheuer1
06-25-2006, 05:01 PM
That really shouldn't be any different than this:


<html>
<head>
<title>Toolbar</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<base target="_blank">
</head>
<body>
<a href="http://cnn.com">CNN</a><br>
<a href="http://msnbc.com">MSNBC</a><br>
<a href="http://news.bbc.co.uk">BBC News</a><br>
</body>
</html>

Try that, and if you still have the same problem then, it isn't the script.

Twey
06-25-2006, 05:18 PM
</head>
<base target="_blank">
</head>Two </head>s?

jscheuer1
06-25-2006, 10:05 PM
Two </head>s?

I was cutting and pasting a bit fast and loose there but, two closing head tags probably wouldn't hurt anything (in that particular case) except the validation. I've corrected it though in my post.