how to stop moving background-image position
<p>I've background image and by using small javascript code, it moves from right to left.</p>

<p>HTML code</p>

<pre><code>&lt;div id="clouds_image"&gt;&lt;/div&gt;
</code></pre>

<p>Javascript code</p>

<pre><code>var g=0;
var speed=30;
function rollClouds() {
document.getElementById('clouds_image').style.backgroundPosition=g+'px 0';
g--;
scroller=setTimeout(function(){rollClouds()},speed);
}
window.addEventListener?
window.addEventListener('load',rollClouds,false):
window.attachEvent('onload',rollClouds);
</code></pre>

<p>But i've noticed that, with time my PC CPU memory usage increased ! causing overload on my pc and if i disabled that javascript code, it back to normal.</p>

<p><strong>My question</strong></p>

<p>so i think i need to modify this javascript code that it <strong>not</strong> keep working forever, i mean, i want to make it to repeat that action only 5 times then stop , maybe i need to define value of <code>g</code> but i'm not good in javascript so any help ~ Thanks.</p>
