---
title: "ypslideoutmenu zweimal auf seite"
url: "https://www.typo3.net/d/84603-ypslideoutmenu-zweimal-auf-seite"
source: "typo3.net"
tags: ["TYPO3","Menüs","Frage","JavaScript & AJAX"]
created: "2008-12-02"
last_reply: "2008-12-04"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# ypslideoutmenu zweimal auf seite

TYPO3 › Menüs · 2 Antworten · gestartet 2008-12-02

## Eröffnungsbeitrag

**lobby** · 2008-12-02 · [Beitrag #1](https://www.typo3.net/d/84603-ypslideoutmenu-zweimal-auf-seite/1)

Hallo, ich will das int_ypslideoutmenu zweimal auf der Seite einbinden. Das erste klappt super, aber beim zweiten gibt es folgende Javascript-Fehler:

```javascript
//bei Rollover
menu185 is not defined

onmouseover(mouseover clientX=0, clientY=0)


//bei MouseOut
obj has no properties
hideMenu("menu185")

onmouseout(mouseout clientX=0, clientY=0)
if (obj.container) {

}
```

Meine Javascriptkenntnisse halten sich auch in Grenzen. Anscheinend werden die Menüpunkte des zweiten Menüs nicht mehr initialisiert.
Kann mir da wer helfen?

## Antworten

### [#2](https://www.typo3.net/d/84603-ypslideoutmenu-zweimal-auf-seite/2) · lobby · 2008-12-02

Bin zwar jetzt schon näher dran, hab aber immer noch keinen Plan. Und zwar muss folgende Funktion in der Datei "typo3conf/ext/int_ypslideoutmenu//class.tx_menu_ypslideoutmenu.php" für das zweite Menü aufgerufen werden:

```php
function extProc_finish ()	{
    
		if ($GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['WMWMmenuItems_l0'] && $GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['WMWMmenuItems_l0'] == $GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['WMWcounter_l0'] && is_array($GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['javascript_layer'])) {
		//if ($this->I['pid'] == $this->conf['special.']['value']) {	
			$string_layer = implode($GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['javascript_layer'], '');
			$string_js = implode(array_reverse($GLOBALS['TSFE']->applicationData['ypSlideOutMenu']['javascript_script']), ';');
			$string_ges = sprintf('ypSlideOutMenu.set_level_one("%s", "%s", %d, %d, %d, %d, %d, %d, %d);var strDiv = \'<div id="%s">%s</div>\';document.write(strDiv);%s;ypSlideOutMenu.writeCSS();', 
								   $this->conf['2.']['moveTo'] ? $this->conf['2.']['moveTo'] : 'down', 
								   $this->conf['korek_css'], 
								   $this->conf['aniLen'] ? $this->conf['aniLen'] : 0 , 
								   $this->conf['hideDelay'] ? $this->conf['hideDelay'] : 50, 
								   $this->conf['minCPUResolution'] ? $this->conf['minCPUResolution'] : 10,
								   $this->conf['kore_ns_x'], 
								   $this->conf['kore_ns_y'], 
								   $this->conf['kore_so_x'], 
								   $this->conf['kore_so_y'], 
								   $this->conf['div_id_layer'] ? $this->conf['div_id_layer'] : 'yymenu', 
								   str_replace('\'', '\\\'', $string_layer),
								   $string_js);
			
	...
		
		return $this->tmpl->wrap($this->WMresult,$this->mconf['wrap']);
		
	}
```

Es wird nur das javascript für das erste Menü erzeugt:

```javascript
ypSlideOutMenu.set_level_one("down", "", 400, 10, 10, 0, 0, -2, -2);
var strDiv = '<div id="yymenu"><div id="menu1768Container"><div id="menu1768Content" class="mmContent"><div class="mmLevel2"><div><a href="index.php?id=1783" onfocus="blurLink(this);" id="act1783" >Seite 1</a></div>
<div><a href="index.php?id=1784" onfocus="blurLink(this);" id="act1784" >Seite 2</a></div>';
document.write(strDiv);
var menu1762 = new ypSlideOutMenu("menu1762", "down", 0, 0, 178, 18, null);
var menu1763 = new ypSlideOutMenu("menu1763", "down", 0, 0, 178, 18, null);
ypSlideOutMenu.writeCSS();
```

Das zweite Menü fehlt!

### [#3](https://www.typo3.net/d/84603-ypslideoutmenu-zweimal-auf-seite/3) · lobby · 2008-12-04

Hat denn da gar keiner einen Ansatz für mich?

---

Quelle: „ypslideoutmenu zweimal auf seite“, typo3.net, https://www.typo3.net/d/84603-ypslideoutmenu-zweimal-auf-seite
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
