Home › Forums › Launch Pad HTML › I found some code to add to your scripts.js
- This topic has 7 replies, 2 voices, and was last updated 11 years, 2 months ago by Howman.
- AuthorPosts
- October 11, 2013 at 2:26 am #6854HowmanParticipant
I removed this
//progressPercentage = 70,
and this
if (progressPercentage < 1) {
progressPercentage = 1;
} else if (progressPercentage > 100) {
progressPercentage = 100;
}
I add this
var target = new Date('10/25/2013'),
today = new Date(),
daysToGo = Math.ceil((target.getTime() - today.getTime() ) / (1000*60*60*24)),
// probably not the best, but it should work
percent = 100 - daysToGo;
and then changed this
var progressBarWrap = $('#progress-bar-wrap');
var progressAmount = $('#progress-amount');
var targetWidth = $('#progress-wrap').width() * (percent / 100);
progressBarWrap.animate({
width: targetWidth
}, progressAnimationSpeed, function() {
$('#moving-arrow').fadeIn('slow');
progressAmount.text(percent + '%').fadeIn('slow');
}).css('overflow', 'visible');
$('#progress-indicator').fadeIn('slow');
But now I have this line
var target = new Date('10/25/2013')
and this
// Enter your launch date
launchDate = {
day: 31,
month: 11,
year: 2013,
hour: 12,
min: 0,
sec: 0
},
How would I use the // Enter your launch date to also set var target = new Date(’10/25/2013′),October 14, 2013 at 9:28 am #6892AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 17, 2013 at 4:07 am #6976HowmanParticipantThank You for your help that seem to have done what I wanted
you can use to code to update launch pad if you like.
topic is now resolved
I am having problems with the facebook app too sorta like “TourneDisque” is and I am using on a live site. I will see what I can do my self. If i can not get it I will start a new topic
thank you once again
October 17, 2013 at 11:02 am #6989HowmanParticipantCan I reopen this I think its not working
cause if I set almost a year say 289 days the progress bar says -189% and that’s not right
I think there is something wrong with the math part of scriptOctober 17, 2013 at 12:52 pm #6991AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 17, 2013 at 7:22 pm #6997HowmanParticipantThis should work
http://www.howman.ca/plugins/under-construction-2/index.html
October 20, 2013 at 1:43 pm #7016AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 21, 2013 at 2:31 am #7024HowmanParticipantI was asking around at the jQuery forum and found out that the last code would work with in 100 days any thing over would show a negative number so this code will work (If you want to use it to update your launch pad you may)
Just now you have set 2 dates in different parts of the code
I just wish I knew more, about coding so I could figure out how to set the 2 dates in the same area of code maybe in time I will be able to do it. You can close this again if you wish
var targetDate = new Date(launchDate.year, launchDate.month - 1, launchDate.day);
var startDate = new Date('8/25/2013');
today = new Date();
daysToGo = Math.ceil((targetDate.getTime() - today.getTime() ) / (1000*60*60*24));
percent = (100 - ((targetDate -today)/(targetDate - startDate)) * 100).toFixed(
- AuthorPosts
- You must be logged in to reply to this topic.