PDA

View Full Version : sorry: No abslute positioning, why?...not working.


BrightNail
05-01-2003, 07:44 PM
Here are my css positioning..

#0_pricesecdisplay {position:absolute; top:542px; left:10px; visibility: hidden; z-index:1;}
#1_pricesecdisplay {position:absolute; top:542px; left:10px; visibility: hidden; z-index:2;}
#2_pricesecdisplay {position:absolute; top:542px; left:10px; visibility: hidden; z-index:3;}

EXAMPLE OF THE TABLES..

<div id = "0_pricesecdisplay"><table border='0' width='540'><tr><td colspan='2'> INFO TABLE 0 </td></tr></table></div>

<div id = "1_pricesecdisplay"><table border='0' width='540'><tr><td colspan='2'> INFO TABLE 1 </td></tr></table></div>

<div id = "2_pricesecdisplay"><table border='0' width='540'><tr><td colspan='2'> INFO TABLE 2 </td></tr></table></div>

***********

When I try to show/hide them, they show up in the exact order as they are in the code...and not even positioned...what gives?..

***********

Show/Hide code:

function showObject(x) {
current=x;
x.visibility = Vissy
if(holder &&(holder!=current)){hideObject(holder);}holder=x;
}
function hideObject(a) {
a.visibility = Hiddy
}

It works...things show and hide, but they are not positioned>>>>

because the page is created dynamically...here is the order of the code..

css
tables
javascript code

thanks......

beetle
05-01-2003, 07:47 PM
<shot mode="inthedark">

Uhh, because you can't ID and element starting with number. The first letter should be alpha [a-zA-Z_]

</shot>

eggman
05-01-2003, 09:07 PM
Actually, there is nothing preventing you from giving objects a numerical ID. You just can't use it as a name reference because that violates Javascript's variable naming conventions. You can use the numerical ID in a calculation though if you follow through with the rules of coercion.

liorean
05-01-2003, 09:22 PM
Oh yes, there are such rules:From [HTML4] (see my sig.):
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
IDREF and IDREFS are references to ID tokens defined by other attributes. IDREF is a single token and IDREFS is a space-separated list of tokens.An attribute of the type ID always have to match the regex /^[a-z][a-z0-9_:.-]+$/i.

eggman
05-02-2003, 03:01 PM
I agree, but that's not what I said or meant.

<div id=2></div>
<div id=3></div>

var x=document.getElementsByTagName("DIV")
var y=x[0].id * 1 * x[1].id

There is nothing stopping you from doing the previous although it is usually not recommended.