I found some code to add to your scripts.js

Home Forums Launch Pad HTML I found some code to add to your scripts.js

This topic is: resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6854
    Howman
    Participant

    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′),

    #6892
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #6976
    Howman
    Participant

    Thank 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

    #6989
    Howman
    Participant

    Can 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 script

    #6991
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #6997
    Howman
    Participant
    #7016
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #7024
    Howman
    Participant

    I 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(

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy