Click to See Complete Forum and Search --> : Simple Code - Sliding Text


Wayne Warren
03-25-2000, 04:05 PM
I am close to finishing up a ColdFusion/HTML project and thought it would
be neat to alter some of it so text lines would slide into place when the
page opens. I have no DHTML experience and, thus, I don't have any DHTML
books. However, I looked in my HTML book and it gave some code which, I'm
afraid, falls far short of clearly explaining where code should be placed
in the program and what it should say. I've gotten text displayed in the
proper "goal spot" but I cannot get it to actually slide from a starting
point to the goal. I hope that is understandable.

If anybody has some simple working code they could just copy and email to
me so I could look at it and figure out where I've gone wrong, I sure would
appreciate it. In advance, thanks for taking mercy on me, a true novice.
Wayne in Dallas

Steve Cochran
03-27-2000, 01:14 PM
You could do something like this:

<DIV id=div1 style="POSITION: absolute; VISIBILITY: hidden">Here is some
text</DIV>
<SCRIPT language="vbs">
dim initX
dim initY
dim finalX
dim finalY
finalX=100
finalY=100
sub window_onload()
initX=1000
initY=1000
div1.style.left=initx & "px"
div1.style.top=inity & "px"
div1.style.visibility="visible"
setTimeout "moveit", 200
end sub
sub moveit()
if initx=finalx then exit sub
initx=initx-10
inity=inity-10
div1.style.left=initx & "px"
div1.style.top=inity & "px"
setTimeout "moveit",5
end sub
</SCRIPT>

check out the WebWorkshop at

www.msdn.microsoft.com/workshop


steve

"Wayne Warren" <warren777@juno.com> wrote in message
news:38dd1c17$1@news.devx.com...
>
> I am close to finishing up a ColdFusion/HTML project and thought it would
> be neat to alter some of it so text lines would slide into place when the
> page opens. I have no DHTML experience and, thus, I don't have any DHTML
> books. However, I looked in my HTML book and it gave some code which, I'm
> afraid, falls far short of clearly explaining where code should be placed
> in the program and what it should say. I've gotten text displayed in the
> proper "goal spot" but I cannot get it to actually slide from a starting
> point to the goal. I hope that is understandable.
>
> If anybody has some simple working code they could just copy and email to
> me so I could look at it and figure out where I've gone wrong, I sure
would
> appreciate it. In advance, thanks for taking mercy on me, a true novice.
> Wayne in Dallas