[Solved] Building my own script for gasoline pump effect


well easiest way is to copy the javascript in that example and put it into its own .js file.

call mootools library script from your html <script src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js"></script>

then call your plugin file <script src="https://stackoverflow.com/questions/12587603/js/plugin.js"></script>

then include your initialization script (from that example, it looks like it goes at the bottom of the page, but im not sure)

<script type="text/javascript" charset="utf-8">
    //<![CDATA[
      window.addEvent('domready', function(){
        var total = $('total'); // this is the id of the element that will display the number
        var totalFx = new Fx.CashRegister(total, {duration: 2000});
        totalFx.start(124353526.99); // this is the number that you want to show first when page loads
        });
</script>

see this jsBin i edited

2

solved Building my own script for gasoline pump effect