Results 1 to 7 of 7

Thread: Space below menu only in Safari - Opera (chromemenu)

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

    Default Space below menu only in Safari - Opera (chromemenu)

    Chromemenu
    http://www.adigitaldreamer.com/indexdhtmlmenu.htm

    I'm working with chrome menu on my site, and am quite happy with it for IE and Firefox. But for Safari (seems like 9% of my viewers use it), and Opera,some funny things happen. In both Safari and Opera, there's a space under the menu of about what looks to be like maybe 50 pixels. Is there any way to remove this space? Is there something that I'm missing there?

    Thanks for any help on this

  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

    There could be a better way and I have no idea if this will work in safari. Also, it changes the layout in FF but not in an unacceptable manner:

    Add this inline style to the menu container:

    Code:
    <div class="chromestyle" id="chromemenu" style="z-index:100;position:relative;">
    and this to the table below it:

    Code:
    <table width="760" border="0" cellpadding="0" cellspacing="0" class="gridbackground" style="margin-top:-15px!important;margin-top:0;position:relative;">
    - 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

    This is a better solution. Once again, I cannot say anything about safari (I have no Mac) but this is good in FF, IE and O. Go back to what you had before my previous solution and add this style section (these rules could be added at the end of the chromestyle.css file as well, or integrated into it:

    Code:
    <script type="text/javascript" src="chromejs/chrome.js">
    
    /***********************************************
    * Chrome CSS Drop Down Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    <style type="text/css">
    .chromestyle {
    position:relative;
    height:2.45em;
    }
    .chromestyle ul{
    position:absolute;
    }
    </style>
    </head>
    
    
    <body bgcolor="#006699" text="#003366" link="#003366" vlink="#006699" alink="#006699" onLoad="">
    - John
    ________________________

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

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

    Default

    Thanks so much for that. It works now on Opera, so hopefully it will work in Safari as well. I'll get someone to check for me.

    Thanks again

    Brian

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

    Default

    What should I check?

    Or... nevermind... i'll just give you a screencap.

    Safari:
    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

  6. #6
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey,thanks!

    Can you check one more thing on Safari? I've been hearing that Safari is showing some flickering on the menu when your mouse goes over the menu headers? is this happening with you?

    Thanks a Million

    I gotta get me a Mac,especially now that you can dual boot with Windows.

    Cheers!

    Brian

    Quote Originally Posted by djr33
    What should I check?

    Or... nevermind... i'll just give you a screencap.

    Safari:

  7. #7
    Join Date
    Jul 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I posted this on another thread, but it may apply here, as well:
    ---
    Hi, all. I patched the dropdown.js script to handle the case where one of the ancestor elements is relatively positioned. In this case, the absolute positioning of the menu is relative to that "containing block" and the offset calculation should end there.

    Here is the modified function (getposOffset), with an nested function to handle IE, Safari, and Firefox:

    Code:
    getposOffset:function(what, offsettype){
      function getStyle(el,styleProp) {
      	if (typeof el.currentStyle != "undefined") {
      		var y = el.currentStyle[styleProp];
      	} else if (typeof document.defaultView != "undefined" && typeof document.defaultView.getComputedStyle != "undefined") {
      		var y = document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);
      	} else {
      		var y = el.style[styleProp];  	  
      	}
      	return y;
      }
      
      var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
      var parentEl=what.offsetParent;
      while (parentEl!=null && getStyle(parentEl, "position") != "relative"){
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
      }
      return totaloffset;
    },

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
  •