Results 1 to 9 of 9

Thread: javascriptkit.com drop down menu LINKS over flash don't work in Firefox

  1. #1
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Question javascriptkit.com drop down menu LINKS over flash don't work in Firefox

    Can someone please look at my code and let me know what I can do to fix this?

    http://johnwboyd.info/drop_down/disciples.htm

    Thanks!

  2. #2
    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

    I've been looking at this some more (we started talking about it in another thread but it was getting off topic). It doesn't appear to be the Flash that is the problem, rather the iframe itself. I think the script will need to be edited and an event attached to the iframe to prevent the flyout from disappearing while the mouse is over the iframe. This shouldn't be happening in the first place, so - its being a bit of a bug in FF, there may not be a solution.

    Please provide a link to the script's demo page on javascriptkit.
    - John
    ________________________

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

  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

    I would still want to look at the demo page for this script to be sure, but I think I have found a solution.

    First of all this:

    Code:
    <script type="text/javascript" src="cssverticalmenu.js">
    
    
    
    
    <SCRIPT LANGUAGE ="Javascript">
    
    <!--
    
    function openWin0(URL) {
    open(URL,"_blank","width=460,height=441,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    
    // -->
    
    </SCRIPT><SCRIPT LANGUAGE ="Javascript">
    
    <!--
    
    function openWin(URL) {
    open(URL,"_blank","width=550,height=700,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    
    // -->
    
    </SCRIPT><SCRIPT LANGUAGE ="Javascript">
    
    <!--
    
    function openWin1(URL) {
    open(URL,"_blank","width=500,height=580,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    
    // -->
    
    </SCRIPT>
    Should be:

    Code:
    <script type="text/javascript" src="cssverticalmenu.js">
    
    /***********************************************
    
    * CSS Vertical List Menu- by JavaScript Kit (www.javascriptkit.com)
    * Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/ 
    * This notice must stay intact for usage
    * Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
    
    ***********************************************/
    
    </script>
    
    <script type="text/javascript">
    function openWin0(URL) {
    open(URL,"_blank","width=460,height=441,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    
    function openWin(URL) {
    open(URL,"_blank","width=550,height=700,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    
    function openWin1(URL) {
    open(URL,"_blank","width=500,height=580,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    </script>
    And later, where you have (just before the opening <body> tag, just after the fade-in script):

    Code:
    <script type="text/javascript" src="cssverticalmenu.js">
    
    /***********************************************
    
    * CSS Vertical List Menu- by JavaScript Kit (www.javascriptkit.com)
    * Menu interface credits: http://www.dynamicdrive.com/style/csslibrary/item/glossy-vertical-menu/ 
    * This notice must stay intact for usage
    * Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
    
    ***********************************************/
    
    </script>
    Just get rid of it. You could probably remove the fade-in script too, as it doesn't look like you are using it on that page.

    Now, replace your existing cssverticalmenu.js file with (additions highlighted):

    Code:
    var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
    var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.
    
    function createcssmenu(){
    for (var i=0; i<menuids.length; i++){
      var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
        for (var t=0; t<ultags.length; t++){
        var spanref=document.createElement("span")
    		spanref.className="arrowdiv"
    		spanref.innerHTML="&nbsp;&nbsp;"
    		ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
        ultags[t].parentNode.onmouseover=function(){
        this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
        this.getElementsByTagName("ul")[0].style.display="block"
        }
        ultags[t].parentNode.onmouseout=function(e){
        var look;
        if(e&&(look=e.relatedTarget))
        while ((look=look.parentNode))
        if(look==this)
        return;
        this.getElementsByTagName("ul")[0].style.display="none";
        }
        }
      }
    }
    
    if (window.addEventListener)
    window.addEventListener("load", createcssmenu, false)
    else if (window.attachEvent)
    window.attachEvent("onload", createcssmenu)
    Last edited by jscheuer1; 02-25-2008 at 02:45 PM. Reason: fix typo
    - John
    ________________________

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

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    johnwboyd (02-25-2008)

  5. #4
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Arrow thanks so much...

    Ok it's working fine now in both browsers! There was an error in the openWin script you provided. The } (in bold below) was missing:

    <script type="text/javascript">
    function openWin0(URL) {
    open(URL,"_blank","width=460,height=441,top=0,left=0,resizable=yes,scrollbars=yes");
    }

    function openWin(URL) {
    open(URL,"_blank","width=550,height=700,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    function openWin1(URL) {
    open(URL,"_blank","width=500,height=580,top=0,left=0,resizable=yes,scrollbars=yes");
    }
    </script>

    1) Do you also know how to get the transparency effect to work in firefox?
    2) Do you know how to get the arrows and respective drop down function to pre-load?

    Thank you.

  6. #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

    Ooops, missed that one, I think I'll go back and fix it. For 1, change:

    Code:
    .glossymenu li ul{ /*SUB MENU STYLE*/
    position: absolute;
    padding-left:2px;
    border:1px #008000;
    width: 190px; /*WIDTH OF SUB MENU ITEMS*/
    left: 0;
    top: 0;
    display: none;
    filter:alpha(opacity=90);
    -moz-opacity:1;
    }
    to:

    Code:
    .glossymenu li ul{ /*SUB MENU STYLE*/
    position: absolute;
    padding-left:2px;
    border:1px #008000;
    width: 190px; /*WIDTH OF SUB MENU ITEMS*/
    left: 0;
    top: 0;
    display: none;
    filter:alpha(opacity=90);
    opacity:0.9;
    }
    For 2, the initialization would need to be moved from (get rid of this):

    Code:
    if (window.addEventListener)
    window.addEventListener("load", createcssmenu, false)
    else if (window.attachEvent)
    window.attachEvent("onload", createcssmenu)
    to a script in the body of the page, just after the menu's markup:

    Code:
     . . . w.dynamicdrive.com/style/">CSS Library</a></li>
        <li><a href="http://tools.dynamicdrive.com/imageoptimizer/">Image Optimizer</a></li>
        <li><a href="http://tools.dynamicdrive.com/favicon/">Favicon Generator</a></li>
        </ul>
    </li>
    </ul><script type="text/javascript">
    createcssmenu();
    </script>
    But I'm not sure if that gets you much, depending upon the browser. The only way to speed its loading up more than that would be to hard code the styles that can be inline to the markup along with the events and added span elements, all of which would defeat the purpose of its being such a simple menu.
    - John
    ________________________

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

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    johnwboyd (02-25-2008)

  8. #6
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Default

    Brilliant! Now if only I can figure out how to code 2 different CSS color schemes for 2 groups of buttons on the same page?
    Last edited by johnwboyd; 02-25-2008 at 06:49 PM.

  9. #7
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Question 2 different vertical button CSS color schemes

    How do I code 2 different CSS color schemes for 2 groups of buttons on the same page?

  10. #8
    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

    I'm not sure I understand the question. If you want one group to look one way, give it one class or id, and for the other group, use a different class or id, and set the styles accordingly for those classes/ids.
    - John
    ________________________

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

  11. The Following User Says Thank You to jscheuer1 For This Useful Post:

    johnwboyd (03-04-2008)

  12. #9
    Join Date
    Feb 2008
    Posts
    83
    Thanks
    26
    Thanked 1 Time in 1 Post

    Thumbs up RE: give it one class or id, and for the other group, use a different class or id...

    Ok thank you! I couldn't figure out how to get the "Ministries" link to be blue also, but it looks great now: http://johnwboyd.info/drop_down/

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
  •