11548 sujets

JavaScript, DOM et API Web HTML5

I have the same problem.

Thanks for all the examples for the menu's
I cannot read and write french so I ask my question in english

I saw in this thread a problem with the flickering in the menu with firefox and mozilla

Can this be fixed or is this a bug in the browsers ?


See my example for the same flickering problem http://213.132.178.235/index.php?quicklink=home
Edited by ceasar (14 May 2005 - 13:11)
Pour ceux que ça intéresse, j'ai un menu du même genre qui sépare encore plus le comportement de la structure:
<edit modo="Olivier">The message in english :
For people who are intersted in, a version of this kind of menu which sperate more behavior and structure and which not flickering</edit>


http://www.labordure.com/ferme/

:)
Modifié par Olivier (14 May 2005 - 13:32)
That one works better. I know there are more solutions but in my cms I have three menu examples which can be edit by an wysiwyg.

My choice was to make them all work with the following menu's
http://css.alsacreations.com/modelesmenus/hd1.htm
http://css.alsacreations.com/modelesmenus/vd1.htm
http://css.alsacreations.com/modelesmenus/vd1.htm

They all do work exept for the flickering in firefox

I also made a nice addon for the vd1.htm.

The javascript uses a cookie so when you are on a submenu and click on a link the submenu will stay open.

montre(false);
function montre(para) {
if(para == false)
{
    for (var i = 1; i<=10; i++) 
    {
      if (document.getElementById('smenu'+i))
      {
       document.getElementById('smenu'+i).style.display='none';
      }
    }
    var menu_to_open = GetCookie('openmenu');
    if(document.getElementById(menu_to_open))
    {
     document.getElementById(menu_to_open).style.display='block';
    }
}else{
      var d = document.getElementById(para);
      for (var i = 1; i<=10; i++) 
      {
          if (document.getElementById('smenu'+i))
          {
             document.getElementById('smenu'+i).style.display='none';
          }
      }
      if(para != false)
      {
              SetCookie('openmenu',para);
      }else{
         var menu_to_open = GetCookie('openmenu');
         if(document.getElementById(menu_to_open))
         {
             document.getElementById(menu_to_open).style.display='block';
         }
      }
      if (d)
      {
  	d.style.display='block';
      }
      }
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

Edited by ceasar (14 May 2005 - 15:19)