Results 1 to 9 of 9

Thread: Chrome CSS Drop Down Menu - Safari

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Chrome CSS Drop Down Menu - Safari

    1) Script Title: Chrome CSS Drop Down Menu (v2.01)

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...rome/index.htm

    3) Describe problem:
    I know this script says that it works in
    FF1+ IE5+ Opr7+

    but has anyone made it so that it also works in Safari and other Mac browsers?

    Paul

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The only issue I'm aware of with this script as far as Safari 2.x is the drop down animation. This should be fixed in the next couple of weeks once I have time.

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

    Default

    Hey,

    wanted to see if we had any progress on the issues with safari or firefox on a mac?

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Ah, sorry, haven't gotten around to it yet. I did notice the problem with the sliding animation no longer occurs in Safari 3 beta, at least not in Windows.

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

    Default Fixes for positioning in IE/Safari/Firefox

    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;
    },

  6. #6
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Ericnguyen,

    I am rather new to editing js files... I have copied the text from your post and replaced it with the similar (but shorter) code in the original chrome.js file. Unfortunately it's still not working on a mac with safari 2.x

    Could you or someone else please help me out here?

    Many thanks

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

    Default

    Do you have a link to the broken page? "Not working" will never help anyone help you.

  8. #8
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I am sorry I should have sent a link, but directly after my original post I was trying some other things and noticed the menu did work on the previous layout of my site. I have then copied the chrome.css part of the old stylesheet over the new stylesheet and I just received an email from my pal that it's working fine now. I apparently made an error in the new stylesheet.

    Thanks for your fast reponse by the way. The Chrome Menu is absolutely perfect as you can see at: http://www.islayinfo.com

  9. #9
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Fix Safari animation?

    The dilemma seems to be with how Safari registers onmouseover events. It keeps triggering to redraw the menu with every tiny mouse movement (keeps triggering onmouseout/onmouseover/onmouseout/onmouseover while the other browsers handle this properly.

    I've been trying to find a way to correct this behavior (test for Safari and disable onmouseout after an onmouseover??) with no luck yet.

    Has anyone successfully fixed this?

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
  •