Forums
This topic is locked
data driven layer positioning
Posted 09 May 2002 15:12:58
1
has voted
09 May 2002 15:12:58 Hrvoje Blazekovic posted:
Please help!!!The problem is - i need to read the layer position (left: ? px; top: ? px<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> from a database to put the layer on the right spot. The values are read corectly but the layer sticks on the same popsition.
How to make the layer go to the position read from the database?
Replies
Replied 12 May 2002 04:42:54
12 May 2002 04:42:54 Andrew Watson replied:
This works.<img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle> <pre id=code><font face=courier size=2 id=code>
<div id="Layer1" style="position:absolute; <%= "left: " & LayerPos.Fields.Item("Left".Value & "px;" %> <%= "top: " & LayerPos.Fields.Item("top".Value & "px;" %> width:100px; height:100px; z-index:1; background-color: #000066; layer-background-color: #000066; border: 1px none #000000"></div>
Cheers
</font id=code></pre id=code>
:: Son, im Thirty.... ::
<div id="Layer1" style="position:absolute; <%= "left: " & LayerPos.Fields.Item("Left".Value & "px;" %> <%= "top: " & LayerPos.Fields.Item("top".Value & "px;" %> width:100px; height:100px; z-index:1; background-color: #000066; layer-background-color: #000066; border: 1px none #000000"></div>
Cheers
</font id=code></pre id=code>
:: Son, im Thirty.... ::
Replied 13 May 2002 08:17:48
13 May 2002 08:17:48 Hrvoje Blazekovic replied:
Thanks!! I came up with a similar solution. It looks like this:
<SCRIPT>
with (document) {
writeln ('<div id="Layer1" style="position:absolute; left:<%=(pos_ulicaRS.Fields.Item("x_pos".Value)%>px; top:<%=(pos_ulicaRS.Fields.Item("y_pos".Value)%>px; width:167px; height:73px; z-index:100; background-color: #FFFF00; layer-background-color: #FFFF00; border: 1px none #000000;"><p><%=(pos_ulicaRS.Fields.Item("karta_id".Value)%><br><%=(pos_ulicaRS.Fields.Item("x_pos".Value)%><br><%=(pos_ulicaRS.Fields.Item("y_pos".Value)%></p></div> ');
}
</script>
It writes the x,y coordinates and a test value from the database ( only for test purpose ).
<SCRIPT>
with (document) {
writeln ('<div id="Layer1" style="position:absolute; left:<%=(pos_ulicaRS.Fields.Item("x_pos".Value)%>px; top:<%=(pos_ulicaRS.Fields.Item("y_pos".Value)%>px; width:167px; height:73px; z-index:100; background-color: #FFFF00; layer-background-color: #FFFF00; border: 1px none #000000;"><p><%=(pos_ulicaRS.Fields.Item("karta_id".Value)%><br><%=(pos_ulicaRS.Fields.Item("x_pos".Value)%><br><%=(pos_ulicaRS.Fields.Item("y_pos".Value)%></p></div> ');
}
</script>
It writes the x,y coordinates and a test value from the database ( only for test purpose ).
Replied 13 May 2002 10:00:52
13 May 2002 10:00:52 Andrew Watson replied:
Hmmm..
That method dosn't seem to work for me, (its what i tried before the above method)
Still, if it works for you.....
Cheers,
Leed
:: Son, im Thirty.... ::
That method dosn't seem to work for me, (its what i tried before the above method)
Still, if it works for you.....
Cheers,
Leed
:: Son, im Thirty.... ::
Replied 13 May 2002 10:12:15
13 May 2002 10:12:15 Hrvoje Blazekovic replied:
Hi!
Everything inside writeln (' -----'); must be in the same line.
Everything inside writeln (' -----'); must be in the same line.