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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem between 2 .js files

Status
Not open for further replies.

itsita001

Programmer
Nov 6, 2002
21
0
0
IL
I have two JavaScripts running, one is a scroller in an iframe. The other is a picture which widens, shrinks and next picture and so oon and so on. Both use setTime() function. When the picture shrinks the scroler stops, i assume it is because both us the setTime function. What should i do?
 
Difficult without looking at your code, but I would say copy the setTime function and call it setTime2 or something like that and then call each one separately, one for the scroller and the other for the picture.
Or post your code and will be easier to advise.
 
If you use the
Code:
setTimeout
function in your
Code:
setTime
function, it's normal because you can only define one timeout in a window BUT you can define as many intervals as you want (they work almost the same way except that they call, and call, and call until you stop them while you must recall your timeout each time you want it to run). To have an idea of how the interval works, see : faq215-2670 Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top