CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   Layer Positioning in IE5 & NS6 (http://www.codingforums.com/showthread.php?t=307)

charon 06-19-2002 08:03 AM

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!

snakedevil1 06-19-2002 11:38 AM

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!

brothercake 06-19-2002 12:24 PM

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>


charon 06-20-2002 02:46 AM

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.

charon 06-20-2002 02:53 AM

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!

charon 06-20-2002 02:59 AM

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!!

snakedevil1 06-20-2002 03:15 PM

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

charon 06-21-2002 05:36 AM

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!!

snakedevil1 06-21-2002 03:46 PM

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.

charon 06-22-2002 02:22 AM

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.

snakedevil1 06-22-2002 04:52 AM

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)

charon 06-22-2002 05:47 AM

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.

charon 06-22-2002 08:15 AM

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

snakedevil1 06-22-2002 03:03 PM

IM not really getting what your saying...
 
Do you mean you want it under the future launches links in the banner?

snakedevil1 06-22-2002 03:14 PM

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?


All times are GMT +1. The time now is 11:18 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.