473,378 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How to repeat this code

How can I get this to repeat an infinite number of times?

Thanks

=================
</head>

<body onload="starttimer()" onunload="stoptimer()">

<script type="text/javascript">
var i=1
function starttimer()
{
myimage.style.position="relative"
myimage.style.left=+i
i++
timer=setTimeout("starttimer()",12)
}

function stoptimer()
{
clearTimeout(timer)
}
</script>
<p>

<img id="myimage" src="Images/housemove.gif" width="209" height="109"
loop="5" />
---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/22/2003
Jul 20 '05 #1
5 9588
While the city slept, Lasse Reichstein Nielsen <lr*@hotpop.com> feverishly
typed:
"George C" <to*@tom.net> writes:
How can I get this to repeat an infinite number of times?


It seems to work for me. What is the problem?


Considering the OP wants it to repeat to infinity, how can you possibly say
it works? ;-) Especially only a quarter of an hour after his post!

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. ni***@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"They got the mustard out!"
Jul 20 '05 #2
try this, will only work in IE though. Don't know if it's the best way to do
it, but modified the code you already had.

<body onload="starttimer()">

<script type="text/javascript">
loc = -209
var ws = document.body.clientWidth;
function starttimer()
{
myimage.style.position="relative";
myimage.style.left=loc;
loc++;
if (loc > (ws))
{
loc = -209;
setTimeout("starttimer()",12)
}
else
{
setTimeout("starttimer()",12)
}
}
</script>
<p>

<img id="myimage" src="Images/housemove.gif" width="209" height="109"/>

Stu

"George C" <to*@tom.net> wrote in message
news:vg************@corp.supernews.com...
How can I get this to repeat an infinite number of times?

Thanks

=================
</head>

<body onload="starttimer()" onunload="stoptimer()">

<script type="text/javascript">
var i=1
function starttimer()
{
myimage.style.position="relative"
myimage.style.left=+i
i++
timer=setTimeout("starttimer()",12)
}

function stoptimer()
{
clearTimeout(timer)
}
</script>
<p>

<img id="myimage" src="Images/housemove.gif" width="209" height="109"
loop="5" />
---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/22/2003

Jul 20 '05 #3
While the city slept, Stuart Palmer <tr**********@youcant.com> feverishly
typed:

[Top posting fixed]
"nice.guy.nige" <ni********@deadspam.com> wrote in message
news:bd************@ID-112325.news.dfncis.de...
Considering the OP wants it to repeat to infinity, how can you
possibly say it works? ;-) Especially only a quarter of an hour
after his post!

what he means is for the code that is written, it does work, it will
continue to move the image to the right indefinatly thus repeating
the move. He did not state what most of us assumed the the poster


I think you missed the humour in my post.

On a more serious note, please post according to the group's style, as can
be found in the FAQ's (posted to the group yesterday and available online at
http://www.jibbering.com/faq/).

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. ni***@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"They got the mustard out!"
Jul 20 '05 #4
Stuart, thank you for continuing to come up with a solution.
"Stuart Palmer" <tr**********@youcant.com> wrote in message
news:bd**********@sp15at20.hursley.ibm.com...
what he means is for the code that is written, it does work, it will
continue to move the image to the right indefinatly thus repeating the move. He did not state what most of us assumed the the poster wanted to do and
repeat the scroll across the screen, it's just a different interpretation of the question, so all parties are correct here.

Stu

p.s I am looking into the solution.

"nice.guy.nige" <ni********@deadspam.com> wrote in message
news:bd************@ID-112325.news.dfncis.de...
While the city slept, Lasse Reichstein Nielsen <lr*@hotpop.com> feverishly typed:
"George C" <to*@tom.net> writes:

> How can I get this to repeat an infinite number of times?

It seems to work for me. What is the problem?


Considering the OP wants it to repeat to infinity, how can you possibly

say
it works? ;-) Especially only a quarter of an hour after his post!

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. ni***@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"They got the mustard out!"


---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/23/2003


---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/23/2003
Jul 20 '05 #5
Works beautifully. Thank you Stuart for the help and common sense approach.

G

"Stuart Palmer" <tr**********@youcant.com> wrote in message
news:sB***************@newsfep3-gui.server.ntli.net...
try this, will only work in IE though. Don't know if it's the best way to do it, but modified the code you already had.

<body onload="starttimer()">

<script type="text/javascript">
loc = -209
var ws = document.body.clientWidth;
function starttimer()
{
myimage.style.position="relative";
myimage.style.left=loc;
loc++;
if (loc > (ws))
{
loc = -209;
setTimeout("starttimer()",12)
}
else
{
setTimeout("starttimer()",12)
}
}
</script>
<p>

<img id="myimage" src="Images/housemove.gif" width="209" height="109"/>

Stu

"George C" <to*@tom.net> wrote in message
news:vg************@corp.supernews.com...
How can I get this to repeat an infinite number of times?

Thanks

=================
</head>

<body onload="starttimer()" onunload="stoptimer()">

<script type="text/javascript">
var i=1
function starttimer()
{
myimage.style.position="relative"
myimage.style.left=+i
i++
timer=setTimeout("starttimer()",12)
}

function stoptimer()
{
clearTimeout(timer)
}
</script>
<p>

<img id="myimage" src="Images/housemove.gif" width="209" height="109"
loop="5" />
---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/22/2003


---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/24/2003


---
I Cor. 10:31
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/24/2003
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: duncan.lovett | last post by:
PHP 4 MySQL 4.0.20 DW MW 2004 7.01 This problem is giving me a bit of a headache, and I'm getting nowhere with it so thought I'd open it up to all, any help would be greatly appreciated. ...
1
kestrel
by: kestrel | last post by:
im using externl css, and i have a menu, and i want to add some css, thta will make an image repeat at the top of my page. i dont know how to sup into my html file, div or what ever. thanks ...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
1
by: nicky77 | last post by:
hi there, i'm pretty inexperienced with CSS, so apologies for the shoddy coding. i'm trying to set a 3 column layout using different background images for each column. however, i have whitespace at...
2
XedinUnknown
by: XedinUnknown | last post by:
Hi! I am new to this forum, but not new to web design and programming. Nevertheless, I have never tried to use PNG so extensively in my pages. here's the problem. First, I have found that the...
7
by: cabman | last post by:
I'm having trouble with a page and getting the background image to repeat itself on the y-axis. Here is a sample of the code: div.main { background-image: url(backround_image.gif);...
4
by: shapper | last post by:
Hello, I am trying to give a background to a Div repeating it on the y direction. Please, notice the alternate of colors: http://www.27lamps.com/Beta/Background/Background.html Does anyone...
0
by: shapper | last post by:
On Sep 25, 1:56 am, shapper <mdmo...@gmail.comwrote: Sherm, Thank you to point that to me. I forgot to hide the gradient on Photoshop and I was all this time going around my CSS. Thank you...
9
by: Mr Prister | last post by:
What I want to do (whether you can or not, I don't know) is: Repeat an image downwards... eg: .somedivisionname{ background: acolor url(apicture.filetype) repeat- center left; } By the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.