hi guys. i've been having trouble with a simple script. what i'm trying to do is get a pic to alternate it's src's back and forth, creating a simple animation. here's my code::
<img src="studio5.jpg" name="karse" border=0>
<script language="javascript">
function bang()
{
if (document.karse.src=='studio5.jpg')
{
document.karse.src="studio6.jpg"
document.write("works1")
}
if (document.karse.src=='studio6.jpg')
{
document.karse.src="studio5.jpg"
document.write("works2")
}
setTimeOut("bang()",100)
}
bang()
</script>
</body>
any help or suggestions on why this isnt working? thanks a lot.
-gitz-
Simple Javascript Animationany help???
Page 1 of 1
9 Replies - 7031 Views - Last Post: 12 June 2002 - 11:21 AM
Replies To: Simple Javascript Animation
#2
Re: Simple Javascript Animation
Posted 11 June 2002 - 07:04 PM
ok, just something that i thought about, but doesn't the <script> tags and everything in between have to be in the head tag, and don't you have to call that javascript function in some manner in order for it to work?
#3
Re: Simple Javascript Animation
Posted 11 June 2002 - 07:07 PM
doesnt necessarily have to be in the head tags. and i'm calling it right after it's declared, before i close the </script>.
#5
Re: Simple Javascript Animation
Posted 12 June 2002 - 08:35 AM
awesome, thanks a lot man:-) i got just what i needed.
-gitz-
-gitz-
#6
Re: Simple Javascript Animation
Posted 12 June 2002 - 08:37 AM
not a problem, glad that i could help, and by the way, i'm a girl
#7
Re: Simple Javascript Animation
Posted 12 June 2002 - 10:01 AM
yeah, well hes not the only one that didnt know that.
#8
Re: Simple Javascript Animation
Posted 12 June 2002 - 10:14 AM
capty you're just two short of 2000 posts!
We should have a P2K celebration :P
We should have a P2K celebration :P
#9
Re: Simple Javascript Animation
Posted 12 June 2002 - 11:20 AM
fyrestorm is a girl? Who woulda thunk it...
everyone knows girls can't code because their logic is whacked...
Hoopster
everyone knows girls can't code because their logic is whacked...
Hoopster
#10
Re: Simple Javascript Animation
Posted 12 June 2002 - 11:21 AM
hey gitz,
Is there any reason you don't just use an animated gif?
Is there any reason you don't just use an animated gif?
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote





|