Web Analytics Made Easy -
StatCounter Layer Positioning in IE5 & NS6 - CodingForum

Announcement

Collapse
No announcement yet.

Layer Positioning in IE5 & NS6

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Layer Positioning in IE5 & NS6

    I know there have differrences in IE5 and NS6 in the CSS position:absolute style attribute, So, i create a reposition function for IE5 and Nestcape6, such as:

    if(ns6){
    obj.style.left = 120;
    obj.style.top = 132;
    }

    it work fine, but when i resize the window (in NS6), the position can't go relative to the windows size.

    please help!! In IE, I use mergin-left and margin-top instead of left and top, then only it work the way as I want it to be.

    Please advice. Thanks!

  • #2
    u probably need to reload the page everytime the window gets resized. or u could change teh properties of the window so that it can't be resized ( the resizable property) no idea whether this or if it will work or not!
    onResize="handlerText"
    to reload, the handler text would be this:
    javascript:location.reload()
    Hope this information helped u out!
    Computers are simple for the complex mind, yet complex for the simple mind

    Comment


    • #3
      here's a generic, cross browser reload/resize trap, which must be in the BODY section



      Code:
      <script language="javascript">
      
      var agt = navigator.userAgent.toLowerCase();
      
      function nsReload() { window.location.reload(); }
      
      function resizeReload() {
      
      	if (window.opera||(agt.indexOf("konqueror")!=-1)) {
      		var newBW=window.innerWidth;
      		var newBH=window.innerHeight;
      		if(newBW==oldBW&&newBH==oldBH){ setTimeout("resizeReload()",100); }
      		else { window.location.reload(); }
      		}
      
      	else if (document.layers) {
      		if (agt.indexOf("win")!=-1) { setTimeout("window.onresize=nsReload", 500); }
      		else { window.onresize=nsReload; }
      		}
      
      	}
      
      if(window.opera||(agt.indexOf("konqueror")!=-1)){
      	var oldBW=window.innerWidth;
      	var oldBH=window.innerHeight;
      	resizeReload();
      	}
      else if (document.layers) { resizeReload(); }
      else { window.onresize=new Function("window.location.reload()"); }
      
      </script>
      "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

      Comment


      • #4
        Urgent!

        would like to add somemore things, that is when I change the screen resolution, the position "out" of the position as well...
        please advice.

        Comment


        • #5
          for better understanding of what I want (previous thread), kindly go to
          http://www.setiahomes.com/johor/index2.html and have a look.
          Thanks You Very Much!

          Comment


          • #6
            continue previous thread.
            after access to the page,
            1.)please mouseover the "futurelaunches" menu (at top banner) and see (in IE 5 and NS6)

            2.) Click on the "property for sales" Link, at side menu, the position display not properly in NS6, after clicking, there have "gap" between Development Progress Link and Futurelaunches.

            Pls advice. Thanks You!!

            Comment


            • #7
              what do u mean?

              do u mean like u want the menu to be straight under it?
              and i just opened it in netsacpe 6 and the postitioning is fine
              Computers are simple for the complex mind, yet complex for the simple mind

              Comment


              • #8
                ah ya, forget to ask you to click (show event) and double click (hide event), then you will know what I mean.
                Thanks You Very Very Much!!

                Comment


                • #9
                  The menu doesn't even work!

                  your menu doesn't work at all in NS6. To fix this, you must implement The DOM way of hiding and showing elements. You're going to have to put in another thing in your if else statement:

                  function showLot(id)
                  {
                  ns6=(document.getElementById) ? true:false
                  ns4=(document.layers)? true:false
                  ie4=(document.all)? true:false
                  if (ns4)
                  { document.layers[id].visibility="show"

                  }
                  else if (ie4)
                  {
                  document.all[id].style.visibility="visible"

                  } else if (ns6)
                  {
                  document.getElementById(id).style.visibility="visible";

                  }
                  }

                  To hide it, the visibility property should be "hidden"

                  Since i don't actually have access to your server, plus i don't really have the time, i can't test and replace the include by myself.
                  Computers are simple for the complex mind, yet complex for the simple mind

                  Comment


                  • #10
                    I don't know why, the "property for sales" side Link can't work on NS6 at your side. My one no problem, can hide and show, but just have a gap between the "Development Progress" Link and "Futurelaunches" Link.

                    MOreover, the position of the "Futurelaunches" menu (banner there) can't stay on the original position when resize it, I want to fix this problem in NS6, in IE it work fine.

                    Comment


                    • #11
                      huh?

                      in NS6 the menu goes to the right a little,u mean u want to fix that?
                      and the links work fine now in my browser, without any gaps or anything. ( compared IE to NS6, couldn't c a difference)
                      Computers are simple for the complex mind, yet complex for the simple mind

                      Comment


                      • #12
                        snakedevil1,

                        ya, you are right, the menu goes to the left a little (resize smaller), it won't fix under the "Futurelaunches" menu (banner there) like what IE5.5..

                        I use NS6.0, what version are you using?? If it work fine, just forget about it...please help me to solve the above problem.

                        Comment


                        • #13
                          the problem that i requested to solve is fix the layer under the futiurelaunches link.

                          Comment


                          • #14
                            IM not really getting what your saying...

                            Do you mean you want it under the future launches links in the banner?
                            Computers are simple for the complex mind, yet complex for the simple mind

                            Comment


                            • #15
                              Can't find teh menu code

                              I've lookes through your code, but can't seem to find the code for the menu. Is it in an include, or in the index of the page?
                              If so, which include is it in?
                              Computers are simple for the complex mind, yet complex for the simple mind

                              Comment

                              Working...
                              X