Countdown Time Display

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
Reddieng
 
 
Posts: 13
Joined: Sun Dec 03, 2017 7:41 pm

Countdown Time Display

Post by Reddieng » Wed Apr 04, 2018 9:55 am

I trying to add a display to show the time to a redirect ie "Redirect in x seconds" where x changes from 10 to 9 to 8 etc. I can set up the re-direct OK but not the display.

I've looked at the Java script options and the Timer facility but this does not seem to offer what I want.

Seems such a simple request, but how do I achieve it?

User avatar
BaconFries
 
 
Posts: 4167
Joined: Thu Aug 16, 2007 7:32 pm

Re: Countdown Time Display

Post by BaconFries » Wed Apr 04, 2018 10:32 am

There is a Page Redirect extension see Page Redirect if you require a script that displays a countdown on the page with a redirect then you will need to implement your own/external script for this using the following:
Add HTML
Example of script (external)
Redirect/Countdown
User made Extension
Redirect

Reddieng
 
 
Posts: 13
Joined: Sun Dec 03, 2017 7:41 pm

Re: Countdown Time Display

Post by Reddieng » Wed Apr 04, 2018 11:39 am

Many thanks for the prompt reply and coding that does exactly what I want.

I have just one problem, and this is due to my very limited technical knowledge of HTML & scripting, so I apologise in advance.

My problem is I added a text box where I wanted the message to be dispalyed and add the code suitably modified with the destination url.

This runs ok and redirects and displays the countdown message but the meassage displays in the top LH corner of the screen not where I put the text.

My inexperience does not let me woek out what I need to do to display the message where I want it. Can you point me in the right direction please. :D

User avatar
Pablo
 
Posts: 13927
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Countdown Time Display

Post by Pablo » Wed Apr 04, 2018 11:46 am

Did you set the HTML object to 'use div'?

Reddieng
 
 
Posts: 13
Joined: Sun Dec 03, 2017 7:41 pm

Re: Countdown Time Display

Post by Reddieng » Wed Apr 04, 2018 1:55 pm

Pablo wrote:
Wed Apr 04, 2018 11:46 am
Did you set the HTML object to 'use div'?
Sorry I did not, (More ignorance on my part)

Reading the original HTML insertion instructions there ere three option:

Insert Custom HTML
Insert Page HTML
Insert Object HTML

I chose the third because I thougt the code wold work where the object was (Obviously not the case)

I also tried it Inside & After Tag - still no joy

I can now see that in the Object Properties > General > Advanced there is mention of Use <div> but the ptions make no sense to me. Is this what I should be setting?

I can only apologise for trying something outside my knowledge zone but that the way we learn. :D

Any more specific instructions about use div as setting this so it display wher I want much appreciated.

User avatar
Pablo
 
Posts: 13927
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Countdown Time Display

Post by Pablo » Wed Apr 04, 2018 2:08 pm

1. Insert an HTML object from the toolbox
2. Double click the object
3. Paste the code.
Note that the object is set to 'use div' by default.

If the code does not work, then either the code is wrong, in complete or there is a conflict with other code on the page.
Unfortunately I cannot help you with the implementation of external code, because for me it may also take hours to figure out how to make it work.

Reddieng
 
 
Posts: 13
Joined: Sun Dec 03, 2017 7:41 pm

Re: Countdown Time Display

Post by Reddieng » Wed Apr 04, 2018 2:51 pm

Have got the redirect indication dispalying top centre above the page which is an acceptable compromise until I sort it out.

Understand about ongoing support, thanks for the help.


PS Perhaps we'll see this functionality in a later realse as standard :?:

User avatar
iamafireman
 
 
Posts: 91
Joined: Mon May 26, 2008 2:41 am
Location: Tennessee

Re: Countdown Time Display

Post by iamafireman » Thu Apr 19, 2018 8:30 pm

If you are still looking, heres a code I just used. Its just a simple count down. I used the redirect in "page properties", used text object to write what ever words you want to say, and then insert the HTML object, with the code, under the text. I have a 5sec count down so just change all the "5s" to what ever you want.
https://www.codingforums.com/javascript ... timer.html

Code: Select all

<script type = "text/javascript">
/*author Philip M. 2010*/

var timeInSecs;
var ticker;

function startTimer(secs){
timeInSecs = parseInt(secs)-1;
ticker = setInterval("tick()",1000);   // every second
}

function tick() {
var secs = timeInSecs;
if (secs>0) {
timeInSecs--;
}
else {
clearInterval(ticker); // stop counting at zero
// startTimer(5);  // remove forward slashes in front of startTimer to repeat if required
}

document.getElementById("countdown").innerHTML = secs;
}

startTimer(5);  // 5 seconds 

</script>

<span id="countdown" style="font-weight: bold;">5</span>

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests