Zum Inhalt springen

2 Scripte korrekt in TypoScript einbinden

Erstellt am 22. Februar 2014 · 1 Antwort · letzte Antwort am 22. Februar 2014

Tags: TYPO3 6.x, Frage

daisy42 ·

Hallo Community,

ich muss zwei <script>-Schnipsel in meinen TypoScript Code einbinden. Ich habe allerdings bisher noch nicht rausgefunden wie es es richtig mache, es scheint immer nur eins der beiden zu funkionieren, je nachdem welches zuerst steht

page.headerData {

(...)

  2 = TEXT
  2.value (

<script>
 
  $(document).ready(function(){
    $("ul.sf-menu").supersubs({
      minWidth:    12,   // minimum width of sub-menus in em units
      maxWidth:    27,   // maximum width of sub-menus in em units
      extraWidth:  1     // extra width can ensure lines don't sometimes turn over
                               // due to slight rounding differences and font-family
    }).superfish();  // call supersubs first, then superfish, so that subs are
                         // not display:none when measuring. Call before initialising
                         // containing tabs for same reason.
  });

  
    var name = "#menu-wrapper";
    var menuYloc = null;
  
    $(document).ready(function(){
        menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))
        $(window).scroll(function () {
            var offset = menuYloc+$(document).scrollTop()+"px";
            $(name).animate({top:offset},{duration:500,queue:false});
        });
    });
 
</script>
  
  )
 
}

Der obere Teil des Scripts ist für mein Menu, der untere Teil dient dazu den "div" um das menu herum mitscrollen zu lassen.
Muss ich beides in getrennte <script> fassen?

Gruss
Martin