Quit Smoking Blogspot

Quit Smoking Blogspot 2 Quit Smoking Blogspot
I need help with javascript code on 2 problems?

http://sawred-helpwithjavascript.blogspot.com/
at the above address on the right you will see “Time since I last smoked” I didn’t have enough room to type code in here.

I need help adding
Cigarettes not smoked, displayed on there (was trying to get number of days and multiply by 20 in a pack)
Amount of money saved

And a bonus of my quit date written on there, that being 1/2/2007 1 am

Any help always appreciated.

Driving me to smoke again

To do what you want, find the line in your javascript that says:

crosscount.innerHTML=opentags+dday+ ” days, “+dhour+” hours, “+dmin+” minutes, and “+dsec+” seconds “+displaymessage+closetags

Replace it with the code below:

//=========== BEGIN additional counters ==========
cigs = dday * 20; // number of cigs not smoked
cigs.toFixed(2); // fix to precision 2

var out = ‘Number of cigarettes not smoked: ‘ + cigs + ‘
‘;

var costpercig = 0.25; // apporx. cost per cigarette
var totalsaved = cigs * costpercig;
totalsaved.toFixed(2); // fix to precision 2

out += Total amount saved: ‘$ + totalsaved + ‘
‘;

crosscount.innerHTML=opentags + dday + ” days, “+dhour+” hours, “+dmin+” minutes, and “+dsec+” seconds “+displaymessage + out + closetags
//========== END additional counters ===========

Jacqueline i quit smoking blog – Januay 14

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Leave a comment

Your comment