View Full Version : CSS Support for NS 4
richardlow
27.05.2001, 22:16
Hi
can anyone help me out here? Just wanna know is z-index supported in NS 4.7 browsers???
I've also linked my images to classes in my CSS file using the following method
imagefilename
I see the effects on IE but not on NS
anyone know what i should do?
thanks
Yup Z-Index is supported <img src=icon_smile_big.gif border=0 align=middle>
What styles are you trying to apply to the image?
<font color=teal>xanth = new Object();
xanth.name = "Mike";
xanth.mail = "[url:b6spt0x6gb]belgedin@earthlink.net[/url:b6spt0x6gb]";
xanth.age = 16;
</font id=teal>
Brian Nickel
27.05.2001, 23:45
CSS directly on images doesn't work in NS4. It tends to **** everything up.
ScriptGuru={
getName:function(){return 'Brian Nickel';},
getEmail:function(){return '[url:y6jwy0rnon]scriptguru@f2s.com[/url:y6jwy0rnon]';},
getURL:function(){return '[url:y6jwy0rnon]http://www.scriptguru.f2s.com[/url:y6jwy0rnon]';}
};
Really? huh I don't think I ever tried applying CSS to images in NS4 before.. that stinks though. heh
<font color=teal>xanth = new Object();
xanth.name = "Mike";
xanth.mail = "[url:pmumfnrshx]belgedin@earthlink.net[/url:pmumfnrshx]";
xanth.age = 16;
</font id=teal>
richardlow
28.05.2001, 03:46
<BLOCKQUOTE id=quote><font size=1 face="Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Yup Z-Index is supported <img src=icon_smile_big.gif border=0 align=middle>
What styles are you trying to apply to the image?
<font color=teal>xanth = new Object();
xanth.name = "Mike";
xanth.mail = "[url:it4bjxlg42]belgedin@earthlink.net[/url:it4bjxlg42]";
xanth.age = 16;
</font id=teal>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Arial, Helvetica" size=2 id=quote>
I'm trying to position my images on the page and at the same time have them overlap another image.
Just got the perfect one for it:
<html>
<head>
<title>viewsrc - z-index demo</title>
<style type="text/css">
body {background:#FFFFFF; color:#333366;}
a {font-family:verdana,arial; text-decoration:none;}
a:link {color:#800000;}
a:visited {color:#800000;}
a:active {color:#800000;}
a:hover {color:#000000; text-decoration:underline;}
div {font-family:verdana,arial;}
.justify {text-align:justify;}
.justify2 {line-height:18px;}
.justify3 {text-align:justify; line-height:18px;}
font {font-family:verdana,arial; color:#333366;}
.text {font-size:11px;}
.text1 {font-size:11px; font-weight:bold;}
.link {font-size:11px; font-weight:bold;}
.h0 {font-weight:bold; font-size:13px;}
.h1 {font-weight:bold; font-size:15px;}
.h2 {font-weight:bold; font-size:18px;}
.h3 {font-weight:bold; font-size:20px;}
#layer1 {position:absolute; left:50px; top:50px; width:400px; height:255px; z-index:1;}
#layer2 {position:absolute; left:100px; top:100px; width:400px; height:255px; z-index:2;}
#layer3 {position:absolute; left:150px; top:150px; width:400px; height:255px; z-index:3;}
#layer4 {position:absolute; left:200px; top:200px; width:400px; height:255px; z-index:4;}
</style>
<script type="text/javascript" language="javascript">
/************************************************** ******************************
Copyright (C) 2001 Rod Morelos
This script is made by and copyrighted to Rod Morelos
wankoi@usa.net || wankoi@hotmail.com
************************************************** ******************************/
// Default browsercheck, added to all scripts!
function checkBrowser()
{
this.ver=navigator.appVersion;
this.dom=document.getElementById?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns6=(this.dom && parseInt(this.ver) >= 5)?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.w3c=(this.ie5 || this.ie6 || this.ns6);
this.ie=(this.ie4 || this.ie5 || this.ie6);
this.ns=(this.ns4 || this.ns6);
this.bw=(this.ie4 || this.ie5 || this.ie6 || this.ns4 || this.ns6);
return this
}
var bw=new checkBrowser();
// Makes crossbrowser object
function makeObject(obj)
{
this.css=bw.w3c?document.getElementById(obj).style :bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0;
return this
}
// default layer on top of other layers
var oldLayer='layer4';
function bringForward(newLayer)
{
oNew = new makeObject(newLayer);
oOld = new makeObject(oldLayer);
oOld.css.zIndex = '0';
oNew.css.zIndex = '5';
oldLayer = newLayer;
}
</script>
</head>
<body>
<div id="layer1">scriptasylum.gif (javascript:bringForward('layer1'))</div>
<div id="layer2">pupius.gif (javascript:bringForward('layer2'))</div>
<div id="layer3">bratta.gif (javascript:bringForward('layer3'))</div>
<div id="layer4">dhtmlcentral.gif (javascript:bringForward('layer4'))</div>
</body>
</html>
Hope this helps.
Rad
[url="http://www.e-syed.net/viewsrc/"]viewsrc[/url:r37by6kps9]
richardlow
28.05.2001, 11:38
Thanks guys for your help!
Solved my problem already. You're rite ScriptGuru, classes can't be applied with the image tag in NS4. I solved my problem by encapsulating my images in <span></span> tags
<font face='Arial'>There might one more intersting thing: don't forget that NN doesn't have any negative index and I prefer using JSSS in NN instead of CSS. </font id='Arial'>
greydaddy
30.05.2001, 16:54
Just as a general note of my experience with layering using css-p. If all the <span> positions are set to 'z-index:0' the first span entered is on the bottom and the last on top, saves messing around with z-index and using javascript to bring forward the image clicked on, using a similar function as Rad describes, anybody else found this?
Yeah all elements Z-Indexes are determined by the order they are read in the document, unless you use the z-index:; style to change that.
<font color=teal>xanth = new Object();
xanth.name = "Mike";
xanth.mail = "[url:438ybb098d]belgedin@earthlink.net[/url:438ybb098d]";
xanth.age = 16;
</font id=teal>
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.