[Typo3] display gmenu_layer only on active parent und prevent rollover

Alexander Heidl aheidl at fulcio.co.uk
Wed Nov 16 09:40:10 CET 2005


Hey guys,

I am struggeling with a layer gmenu at http://dev.melbea.fulcio.co.uk. As
you can see the submenu is layer based and visible according to the position
of its parent. I have done it this way because I want the submenu start at
the same Y position then the parent.

What I want to achieve now is to show the submenu only upon the ACT state of
the parent; hence to prevent the roll over effect. I don't want the submenu
layer to appear on any rollover, but only show the submenu of the current
active main menu item.

Anyone any idea?

BR,

Alex Heidl
http://www.fulcio.co.uk

NB: Here is my TS code snippet:

# --------------------------------------------------------------------------
# Main Menu
# --------------------------------------------------------------------------
includeLibs.gmenu_layers = media/scripts/gmenu_layers.php
lib.mainnav = HMENU
lib.mainnav.entryLevel = 0
lib.mainnav.maxItems = 5

lib.mainnav.1 = GMENU_LAYERS
lib.mainnav.1.wrap = <table width="100%" border="0" cellspacing="0"
cellpadding="0">|</table>
lib.mainnav.1 {
  
  layerStyle =
position:absolute;left:126px;top:0px;width:126px;VISIBILITY:hidden;
  displayActiveOnLoad = 1
  expAll = 1
  freezeMouseover = 1
  #freezeMouseover.alwaysKeep = 1
  dontHideOnMouseUp = 1
  
  #Variant 1
  #yPosOffset = -50
  #lockPosition = y
  #lockPosition_addSelf = 1
  
  #Variant 2
  relativeToTriggerItem = 1
  relativeToTriggerItem.addWidth = 1
  
  # inactive
  NO {
    allWrap = <tr><td>|</td></tr>
    backColor = #E0E0E0
    XY = 126, 25
    
    10 = IMAGE
    10 {
      file.import = uploads/media/
      file.import.field = media
      file.import.listNum = 0
      align = center
    }

    15 = BOX
    15 {
      dimensions = 120,0,6,25
      color = #FFCC33 || #CCFF33 || #99CCFF || #FFFF33 || #FF9999
    }

    20 = TEXT
    20 {
      niceText = 1
      align = left
      text.field = title
      #text.case = upper
      offset = 10,18
      spacing = 0
      fontFile = {$pathToFonts}arlrdbd.ttf
      fontSize = 16
      fontColor = #666666
    }
  }

  RO < .NO
  RO {
    backColor = #FFCC33 || #CCFF33 || #99CCFF || #FFFF33 || #FF9999
  }
  RO = 1
  
  ACT < .RO
  ACT {
    backColor = #FFCC33 || #CCFF33 || #99CCFF || #FFFF33 || #FF9999
    15.color = #E0E0E0
  }
  ACT = 1
}

# --------------------------------------------------------------------------
# Sub Menu
# --------------------------------------------------------------------------

lib.mainnav.2 = GMENU
lib.mainnav.2 {

  # inactive
  NO {
    allWrap = |<br>
    backColor = #F1F1F1
    XY = 126, 25
    
    10 = IMAGE
    10 {
      file.import = uploads/media/
      file.import.field = media
      file.import.listNum = 0
      align = center
    }

    20 = TEXT
    20 {
      niceText = 1
      align = left
      text.field = title
      #text.case = upper
      offset = 10,16
      spacing = 0
      fontFile = {$pathToFonts}arlrdbd.ttf
      fontSize = 12
      fontColor = #666666
    }
  }

  RO < .NO
  RO {
    backColor = #E0E0E0
  }
  RO = 1
  
  ACT < .RO
  ACT {
    
  ACT = 1
}





More information about the TYPO3-english mailing list