> No offences but not a big fan of js fiddle coz most of my code just
> doesn't work over there, while it does on chrome. I did not try this
> one though.
when you're building the fiddle it will force you to only add the code
necessary for your particular use-case.
If your code isn't running in fiddle, you either need to add
dependency functions, or reduce the functionality within the fiddle to
make it work. If it's too difficult to extract small portions of
functionality out of your application, you might want to think about
refactoring your code altogether. Having tightly coupled code always
begets more problems.
Like Ryan said, breaking your problem down into it's simplest terms
usually is the best way to understand and solve the problem (which is
why everyone here requests a fiddle over a vague description of a
problem).
Also, use:
window.addEvent('load',function(){
...
});
So you can potentially add more functions to the load event in the
future.
- Chase
> > Few things:
> > 1.http://jsfiddle.net
> > 2. Mootools is a javascript framework. It enhances JS, not replace it. So
> > whatever you use in JS will work fine. setTimeout is no exception.
>
> > On Wed, Oct 6, 2010 at 10:09 AM, shouvik <[email protected]> wrote:
> > > I have a java script which I would like to write using motools so that
> > > I can use it in another script I am writing.
>
> > > //Countdown Timer Script
> > > window.onload = function()
> > > {
> > > num = document.getElementById('left');
> > > fps= 40;
> > > seconds = 60;
>
> > > var total = fps*seconds;
> > > for(var i=total;i>=0;i--)
> > > {
> > > var delayed = (function()
> > > {
> > > var step = 1-i/total;
> > > var left = Math.ceil(i/fps);
> > > return function()
> > > {
> > > num.innerHTML=left;
> > > };
> > > })();
>
> > > setTimeout(delayed,-1000/fps*(i-total));
> > > }
> > > }
>
> > > Issue is I don't know how I should work with this
> > > "setTimeout(delayed,-1000/fps*(i-total));". To the best of my
> > > knowledge there is no setTimeout function in mootools. Please help!
>
> > --
> > Arieh Glazer
> > אריה גלזר
> > 052-5348-561
> > 5561