473,322 Members | 1,736 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,322 software developers and data experts.

javascript animation eating all memory

I have this bit if javascript and it animates an image well, the
problem is that the more it runs the more memory it eats on the client
machine. Can anyone help me make this not eat all avaliable memory,
notice the recurrision, that may be it...is there a better way to it or
free the last process ran...please help :D

<script>
// The following script implements rotating and fading the merchant
logos.
// Fade effect only in IE; degrades gracefully
// Set slideShowSpeed (milliseconds)
var(slideShowSpeed = 1)
// Duration of crossfade (seconds)
var(crossFadeDuration = 3)
// Specify the image files
var(Pic = New Array())
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'

var(t)
var(j = 0)
var(p = Pic.length)
var(PreLoad = New Array())
for (i = 0; i < p; i++){
PreLoad([i] = New Image())
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter='blendTrans (duration=2)'

document.images.SlideShow.style.filter='blendTrans (duration=crossFadeDuration)'
document.images.SlideShow.filters.blendTrans.Apply ()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play( )
}
j = j + 1
if (j (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>

Aug 28 '06 #1
1 1663
The memeory seems to be unloading now after each loop...maybe something
else was wrong, so I guess we can ignore this....sorry about that.
gencode wrote:
I have this bit if javascript and it animates an image well, the
problem is that the more it runs the more memory it eats on the client
machine. Can anyone help me make this not eat all avaliable memory,
notice the recurrision, that may be it...is there a better way to it or
free the last process ran...please help :D

<script>
// The following script implements rotating and fading the merchant
logos.
// Fade effect only in IE; degrades gracefully
// Set slideShowSpeed (milliseconds)
var(slideShowSpeed = 1)
// Duration of crossfade (seconds)
var(crossFadeDuration = 3)
// Specify the image files
var(Pic = New Array())
// to add more images, just continue
// the pattern, adding to the array below
Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'

var(t)
var(j = 0)
var(p = Pic.length)
var(PreLoad = New Array())
for (i = 0; i < p; i++){
PreLoad([i] = New Image())
preLoad[i].src = Pic[i]
}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter='blendTrans (duration=2)'

document.images.SlideShow.style.filter='blendTrans (duration=crossFadeDuration)'
document.images.SlideShow.filters.blendTrans.Apply ()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play( )
}
j = j + 1
if (j (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
Aug 28 '06 #2

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

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
2
by: billrdio | last post by:
I am trying to make a JavaScript animation of real-time images - i.e. images that will periodically change on the server. The problem I am having is that the JavaScript animation I have created is...
5
by: wmschneider | last post by:
I am trying to make a progress animation so that the user knows that there files are correctly being checked in. Trying to animate papers moving from the computer to the server pics. I'm brand...
8
by: Beam_Us_Up_Scotty | last post by:
Hello all, I am trying to write a "simple" animation using C#, and I've tried many things but nothing seems to work for me without leaking memory. Here's a very simple piece of code that uses a...
1
by: Scott | last post by:
I have an asp.net page that performs a function for a user that can take up to 30 seconds. So, I have a javascript function that shows an animation to let the user know something is going on. I...
2
by: Chris | last post by:
Hi, I have a Javascript function that loads a page with a progress bar for long process. The progress bar is a gif animation and for some reason it the animation is stuck when the function is...
5
by: Per B. Sederberg | last post by:
Hi Everybody: I'm having a difficult time figuring out a a memory use problem. I have a python program that makes use of numpy and also calls a small C module I wrote because part of the...
4
by: Sin Jeong-hun | last post by:
Most applications, including Windows Explorer, show some sort of 'wait' dialog with animation when a lengthy operation is going on. For example, When the Windows Explorer is searching for...
6
by: dantz | last post by:
HI everyone, I hope someone can help me on this. I have form application that has 3 Timers that does an animation (changing an image for every interval) Each image are loaded at start of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.