From cd2a7a108abb3273479612b5fd78a5a1e1ae6587 Mon Sep 17 00:00:00 2001 From: pete Date: Sat, 16 Aug 2008 20:14:07 +0000 Subject: avatar menu in IE, z-index bug work-around git-svn-id: https://code.elgg.org/elgg/trunk@1976 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/views/default/profile/css.php | 1 - mod/profile/views/default/profile/javascript.php | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'mod/profile/views/default') diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php index 63dcabf50..234d6fb39 100644 --- a/mod/profile/views/default/profile/css.php +++ b/mod/profile/views/default/profile/css.php @@ -24,7 +24,6 @@ } .usericon div.sub_menu { - /* z-index:9999; */ display:none; position:absolute; padding:2px; diff --git a/mod/profile/views/default/profile/javascript.php b/mod/profile/views/default/profile/javascript.php index 78cfb396c..24bf20689 100644 --- a/mod/profile/views/default/profile/javascript.php +++ b/mod/profile/views/default/profile/javascript.php @@ -18,12 +18,15 @@ ?> +var submenuLayer = 1000; + function setup_avatar_menu() { // avatar image menu link $("div.usericon img").mouseover(function() { // find nested avatar_menu_button and show $(this.parentNode.parentNode).children("[class=avatar_menu_button]").show(); + //$(this.parentNode.parentNode).css("z-index", submenuLayer); }) .mouseout(function() { if($(this).parent().parent().find("div.sub_menu").css('display')!="block"){ @@ -62,12 +65,13 @@ function setup_avatar_menu() { .fadeIn('normal'); } - // fix for z-index / jquery bug - //$(this).css("z-index", parseInt( new Date().getTime()/100000000 )); - //avatar.css("z-index", parseInt( new Date().getTime()/100000000 )); + // fix for ie z-index bug //submenu.css("z-index", parseInt( new Date().getTime()/100000000 )); - //alert("submenu z-index = " +submenu.css("z-index")); + avatar.css("z-index", submenuLayer); + submenu.css("z-index", submenuLayer+1); + + submenuLayer++; // change arrow to 'on' state $(this).attr('src','_graphics/avatar_menu_arrow_open.gif'); @@ -77,6 +81,8 @@ function setup_avatar_menu() { $("div.sub_menu:visible").not(submenu).hide(); $(".usericon img.arrow").not(this).attr('src','_graphics/avatar_menu_arrow.gif'); $(".avatar_menu_button").not(this).hide(); + + //alert("submenuLayer = " +submenu.css("z-index")); }) // hover arrow each time mouseover enters arrow graphic (eg. when menu is already shown) .mouseover(function() { $(this).attr('src','_graphics/avatar_menu_arrow_hover.gif'); }) -- cgit v1.2.3