Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 11-05-2009, 10:47 AM timer script
Nicky s's Avatar
Experienced Talker

Posts: 44
Name: nick
Trades: 0
hey i am using the script below on my site if you look here you can see what it dose filmfast.co.uk/s1e1.php

now what i want it to do is when some clicks the ad it loads the video striaght away and cancles the timer if that makes any sence

can it be done ?

Code:
<div align="center" class="style29"><div id="mycontent" style="display:none">
            <script type="text/javascript"><!--
google_ad_client = "pub-9670252957648140";
/* 250x250, created 21/09/09 */
google_ad_slot = "8877296912";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
            <script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
            <br />
            <br />
            <img src="loading.gif" width="16" height="16"><br />
            <span id="countdown">Loading...</span><br />
            <strong><span class="style30">Click the Ad to Watch Now!</span></strong><span class="style30"></span><br />
            </div>
            
            <script type="text/javascript">
function countdown(count)
{
document.getElementById("countdown").innerHTML="Video Loading... <b>"+count+"</b> seconds remaining...";
count-=1;
 if(count>=0)
 setTimeout("countdown("+count+")",1000);
 else
 custom();
}
function custom()
{
 document.getElementById("mycontent").innerHTML='<object width="640" height="350"><param name="movie" value="http://www.megavideo.com/v/FFNB0V502...</param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/FFNB0V502...53170fc3901f65" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="350"></embed></object>';
}
document.getElementById("mycontent").style.display="block";
countdown(10);
</script>
            <br />
          </div>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Sell Website Templates & Earn 25% Commission - Nsrr-uk.com
Nicky s is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2009, 09:38 PM Re: timer script
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Try something like this:

HTML Code:
<div align="center" class="style29"><div id="mycontent" style="display:none">
            <script type="text/javascript"><!--
google_ad_client = "pub-9670252957648140";
/* 250x250, created 21/09/09 */
google_ad_slot = "8877296912";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
            <script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
            <br />
            <br />
            <img src="loading.gif" width="16" height="16"><br />
            <span id="countdown">Loading...</span><br />
            <strong><span class="style30" onClick="custom();">Click the Ad to Watch Now!</span></strong><span class="style30"></span><br />
            </div>

            <script type="text/javascript">
var current_timer = null;
function countdown(count)
{
document.getElementById("countdown").innerHTML="Video Loading... <b>"+count+"</b> seconds remaining...";
count-=1;
 if(count>=0)
 current_timer = setTimeout("countdown("+count+")",1000);
 else
 custom();
}
function custom()
{
  if (current_timer != null) {
    clearTimeout(current_timer);
  }
 document.getElementById("mycontent").innerHTML='<object width="640" height="350"><param name="movie" value="http://www.megavideo.com/v/FFNB0V502...</param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/FFNB0V502...53170fc3901f65" type="application/x-shockwave-flash" allowfullscreen="true" width="640" height="350"></embed></object>';
}
document.getElementById("mycontent").style.display="block";
countdown(10);
</script>
            <br />
          </div>
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to timer script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23421 seconds with 12 queries