When you click an item they are cloned in a new ordered list. Problem is every time a new item is clicked all the saved items in the new list fadeIn. Does anyone know how to make it so just the newly clicked item does the fadeIn effect??
A better way would be to first hide it, then append it, and then fade in. i.e. :
var clone=$(this).clone(false).hide();
$("#Save ol").append(clone);
clone.fadeIn(500);
Paul’s version should also work in theory, but can have timing issues in that it already faded in when it’s appended (on slow -or heavily loaded- systems), so you don’t see the intended effect.
When you remove an item from the new list an alert pops up with the current total minus the amount from the item that was clicked. The alert sum is correct but for some reason the total is not updating and removing the value that is in the pop up… Can someone explain how to get this working ??
This brings me onto another question This script currently doesn’t save items that have been added to the saved list but if I was to add this feature how could it be done? Would it be storing cookies and sessions? Right now if you add items and refresh the browser the items will vanish. It would be good to know how to fix this but it is not critical. Thanks for all your help
After adding a few items to the saved list and at some point the total explodes into a bigger number… I am a bit stumped as to what to do?? How can I limit only 2 numbers to appear after the decimal? I’ve tried adding .toFixed(2)
I have added .slice(0,5) to the total which hides the “explosion”… Only problem I can see with this is if the total goes over 5 digits but for this is not an issue for this project.
What is the reason for the calculation to explode like that in the first place? How come toFixed(2) wasn’t working?