Results 1 to 7 of 7

Thread: AnyLink Drop Down Menu block popups ??

  1. #1
    Join Date
    Jun 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default AnyLink Drop Down Menu block popups ??

    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 ??
    i think almost 80% of the surfers are using popup blockers , so they never see my links

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by minnie
    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 ??
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jun 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    here is the code
    when i click on a link in the menu google toolbar blocks the links

    HTML Code:
    <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>

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That really shouldn't be any different than this:

    HTML Code:
    <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.
    Last edited by jscheuer1; 06-25-2006 at 10:02 PM. Reason: correct demo code
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by jscheuer1
    Code:
    </head>
    <base target="_blank">
    </head>
    Two </head>s?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •