Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with dynamic DIV

Status
Not open for further replies.

ma701sd

IS-IT--Management
Dec 15, 2000
94
GB
Hi, Can anyone help...

What im trying to do is as follows:

I capture and X and Y co-ordinate and then position using
<STYLE TYPE=&quot;text/css&quot;>
#positionElement1
{
position:absolute;
top: <CFOUTPUT>PositionElement1X</cfoutput>px;
left: <cfoutput>PositionElement1Y</cfoutput>px;
}
</style>

And If I want to position an element I just use this tag:
<DIV ID=&quot;PositionElement1&quot;>
&quot;the object I want to position&quot;
</div>

So what happens is that &quot;<div ID=&quot;PositionElement1&quot;>...</Div>
then goes back up to the CSS code above and positions whatever I want using the X and Y co-ordinate.

This is OK when positioning one at a time e.g. If I want to position another element I just reference another CSS style stylesheet and give it another name e.g.
<STYLE TYPE=&quot;text/css&quot;>
#positionElement2
{
position:absolute;
top: <CFOUTPUT>PositionElement2X</cfoutput>px;
left: <cfoutput>PositionElement1Y</cfoutput>px;
}
</style>

This works fine, But is it possible to display 2 or more positioned elements simultaneously using their respective co-ordinates i.e.
<DIV ID=&quot;PositionElement2&quot;>
&quot;the object I want to position&quot;
</div>

<DIV ID=&quot;PositionElement2&quot;>
&quot;the object I want to position&quot;
</div>
The X and Y co-ordinates are being retrieved from a database

ANy comments or suggestions will be greatly appreciated..

Many thanks

Sam....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top