Philipp Packheiser: Layer anzeigen in Netscape

guten morgen liebes forum,
bitte schaut euch mal unter
http://www.alpha-visions.com/fenstertroll
auf die "fenster" seite an. eigentlich sollte, wenn man mit der maus über die bilder kommt ein popup erscheinen, was mit dem ie auch wunderbar funktioniert. mit dem netscape 4.x zwar auch jedoch ab version 6 sieht man gar nix mehr! der eigentliche code steht in einer externen *.js datei. wenn mir jemand weiterhelfen könnte, kann ich ihm auch gerne die dazugehörige datei schicken.
leider bin ich nicht so fit wie ihr in bezug auf netscape :-(...

vielen dank für eure mühe!

mfg
philipp packheiser

  1. Hallo,

    Du mußt hier mit
    document.detElementById["layername"].style;
    arbeiten.

    Gruß riethmunk

    1. Hallo,

      Du mußt hier mit
      document.detElementById["layername"].style;
      arbeiten.

      Gruß riethmunk

      erstmal vielen dank für die schnelle antwort...
      jedoch muss ich gestehen, dass ich keine ahnung hab wo ich den code intragen soll!?

      in der javascript datei sieht es bis jetzt so aus:
      _____________________________________________________________________
       text=new Array();
         title=new Array();

      title[1]="Kunststoff";
       text[1]="Finstral Top 72<br> ";

      var x = 0;
       var xx=10;
       var yy=-140
       var y = 0;
       var showit = -20;

      // Welchen Browser haben wir denn...
          // ----------------------------------
          ns = (document.layers)? true:false
          ie4 = (document.all)? true:false
          ie5 = false;
          if (ie4) {
           if (navigator.userAgent.indexOf('MSIE 5')>0) {
            ie5 = true;
           }
          }

      // Welche Plattform? bei IE auf MAC keine popi-Fenster

      if ( navigator.platform.substring(0,3).toUpperCase() == "MAC" && (ie4 || ie5) )
       {
          mac = true;
          } else {
          mac = false;
          }

      if ( (ns) || (ie4) ) {
           if (ns) over = document.popDiv
           if (ie4) over = popDiv.style
           document.onmousemove = mouseMove
           if (ns) document.captureEvents(Event.MOUSEMOVE)
          }

      function wtl(txt) {
           if (ns) {
            var lll = document.popDiv.document
            lll.write(txt)
            lll.close()
           } else {
            if (ie4) document.all["popDiv"].innerHTML = txt
           }
          }

      function show(obj) {
           if (ns) obj.visibility = "show"
           else if (ie4) obj.visibility = "visible"
         }

      function hide(obj) {
           if (ns) obj.visibility = "hide"
           else if (ie4) obj.visibility = "hidden"
          }

      function moveTo(obj,lx,ly) {
           obj.left = lx
           obj.top = ly
          }

      function hideit() {
           if (mac) {return;}

      if ( (ns) || (ie4) )  {
            showit = 0;
            hide(over);
           }
          }

      // Popup zusammenbasteln
          // ---------------------
          function rpopi(text, title) {
           txt = "<TABLE WIDTH=260 BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#9c252d"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD><SPAN ID="thetext"><B><FONT face="Arial, Helvetica" size=-1 class="lt" color="#cccccc">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#ffffff"><TR><TD><SPAN ID="thetext2"><FONT face="Arial, Helvetica" COLOR="#000000" size=-2>"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
              wtl(txt);
           display_it();
          }

      function popi(i,xm) {
        if (mac) {return;}
        xx=xm;
        rpopi(text[i],title[i]);
          }

      // ...und jetzt anzeigen
          // ---------------
          function display_it() {
           if ( (ns) || (ie4) ) {
            if (showit == 0)  {
             moveTo(over,x+xx,y+yy);
             show(over);
             showit = 1;
            }
           }
          }

      // Auf mousemoves reagieren
          // -----------------------
          function mouseMove(e) {
           if (ns) {x=e.pageX; y=e.pageY;}
           if (ie4) {x=event.x; y=event.y;}
           if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
           if (showit) {
            moveTo(over,x+xx,y+yy);
           }
          }
      _____________________________________________________________________

      bitte gebe mir doch noch einen tipp, an welcher position dein vorschlag zu realisieren ist!

      vielen dank für deine mühe

      mfg
      Philipp Packheiser

      1. Hi,

        Du mußt hier mit
        document.detElementById["layername"].style;
        arbeiten.

        nicht detElementById sondern: getElementById

        erstmal vielen dank für die schnelle antwort...
        jedoch muss ich gestehen, dass ich keine ahnung hab wo ich den code intragen soll!?

        Ersetzte solche Konstrukte wie: document.all[popDiv]
        durch document.getElementById(popDiv)

        Die extra Abfrage für Netscape kannst du dann auch weglassen,
        allerdings kennt der veraltete N4.x getElement noch nicht, falls du diesen Browser nicht ausschließen möchtest, solltest du hier mit document.layers[popDiv] arbeiten.

        Gruß

        ueps

        1. hallo "uepselon",
          vielen dank für deine schnelle antwort im forum.
          kannst du mir evtl. genau schreiben wo ich im folgenden javascript-code deinen vorschlag getElementById umsetzen sollte!?

          _________________________________________________________________________________________________________

          var x = 0;
           var xx=10;
           var yy=-140
           var y = 0;
           var showit = -20;

          // Welchen Browser haben wir denn...
              // ----------------------------------
              ns = (document.layers)? true:false
              ie4 = (document.all)? true:false
              ie5 = false;
              if (ie4) {
               if (navigator.userAgent.indexOf('MSIE 5')>0) {
                ie5 = true;
               }
              }

          // Welche Plattform? bei IE auf MAC keine popi-Fenster

          if ( navigator.platform.substring(0,3).toUpperCase() == "MAC" && (ie4 || ie5) )
           {
              mac = true;
              } else {
              mac = false;
              }

          if ( (ns) || (ie4) ) {
               if (ns) over = document.popDiv
               if (ie4) over = popDiv.style
               document.onmousemove = mouseMove
               if (ns) document.captureEvents(Event.MOUSEMOVE)
              }

          function wtl(txt) {
               if (ns) {
                var lll = document.popDiv.document
                lll.write(txt)
                lll.close()
               } else {
                if (ie4) document.all["popDiv"].innerHTML = txt
               }
              }

          function show(obj) {
               if (ns) obj.visibility = "show"
               else if (ie4) obj.visibility = "visible"
             }

          function hide(obj) {
               if (ns) obj.visibility = "hide"
               else if (ie4) obj.visibility = "hidden"
              }

          function moveTo(obj,lx,ly) {
               obj.left = lx
               obj.top = ly
              }

          function hideit() {
               if (mac) {return;}

          if ( (ns) || (ie4) )  {
                showit = 0;
                hide(over);
               }
              }

          // Popup zusammenbasteln
              // ---------------------
              function rpopi(text, title) {
               txt = "<TABLE WIDTH=260 BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR="#9c252d"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD><SPAN ID="thetext"><B><FONT face="Arial, Helvetica" size=-1 class="lt" color="#cccccc">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#ffffff"><TR><TD><SPAN ID="thetext2"><FONT face="Arial, Helvetica" COLOR="#000000" size=-2>"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
                  wtl(txt);
               display_it();
              }

          function popi(i,xm) {
            if (mac) {return;}
            xx=xm;
            rpopi(text[i],title[i]);
              }

          // ...und jetzt anzeigen
              // ---------------
              function display_it() {
               if ( (ns) || (ie4) ) {
                if (showit == 0)  {
                 moveTo(over,x+xx,y+yy);
                 show(over);
                 showit = 1;
                }
               }
              }

          // Auf mousemoves reagieren
              // -----------------------
              function mouseMove(e) {
               if (ns) {x=e.pageX; y=e.pageY;}
               if (ie4) {x=event.x; y=event.y;}
               if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
               if (showit) {
                moveTo(over,x+xx,y+yy);
               }
              }
          ______________________________________________________________________________________________________________________________

          vielen dank für deine mühe

          mfg

          *** Philipp Packheiser ***

          1. Hi,

            vielen dank für deine schnelle antwort im forum.
            kannst du mir evtl. genau schreiben wo ich im folgenden javascript-code deinen vorschlag getElementById umsetzen sollte!?

            Zuerst die Definition von over anders machen:

            if ( (ns) || (ie4) ) {
                 if (ns) over = document.layers["popDiv"];
                 if (ie4) over = document.all["popDiv"].style;
                 }

            Anmerkung, um allen Browsern gerecht zu werden (z.B. Mozilla)solltest du noch folgendes einbauen:

            if ((!ie4 && !ns)) over = document.getElementById("popDiv").style;

            Wenn du dass machst, musst du aber an andere Stelle evtl. noch weiter Änderungen vornehmen.

            Die show und hide funktionen sollten so ausehen (show und hide gibt es nicht):

            function show(obj) {
                 obj.visibility = "visible"
               }

            function hide(obj) {
                 obj.visibility = "hidden"
                }

            Gruß

            ueps

            1. vielen dank für deine mühe ich hoffe es klappt!

              mfg Philipp Packheiser

            2. hi ueps....

              geh´t auch nicht...! hab die topic nochmal neu ins forum gestellt. wenn du noch die nerven bzw. die ruhe dazu hast kannst du ja nochmals vorbeischauen.

              vielen dank trotz allem

              Philipp Packkheiser