Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help needed - number to %

    Hi All,

    Im a total novice with coding other than html/css.

    I have a video xml which, in which i need a new feature, could you help me with that?

    Basically my video is being entered with a time of it - for example 30sec.

    I have start and end trackers firing for the video but now i want to add impression trackers at 25%, 50%, 75%. I managed to do it using specifying seconds for the calls, but it becomes a pain to recalculate seconds for every video.

    Any ideas I could follow?

    Thanks,
    AD

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,079
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Try this:-

    Code:
    <script type = "text/javascript">
    
    var videotime = 30;
    var t25 = Math.round(videotime *.25);
    var t50 = Math.round(videotime *.5);
    var t75 = Math.round(videotime *.75);
    
    </script>

    The avoidance of taxes is the only intellectual pursuit that carries any reward. - Anon
    Last edited by Philip M; 12-12-2010 at 11:01 AM. Reason: Typo


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •