Giter Site home page Giter Site logo

Forward to URL at Zero about timecircles HOT 4 CLOSED

wimbarelds avatar wimbarelds commented on July 19, 2024
Forward to URL at Zero

from timecircles.

Comments (4)

wimbarelds avatar wimbarelds commented on July 19, 2024

This should be quite simple:

$("#Countdown").TimeCircles().addListener(function(unit, value, total) {
    if(total == -10) {
        location.href="http://www.google.com";
    }
});

However, if this is all you'd like to do- or generally you'd like to do something as simple as this- it could also be done without TimeCircles:

setTimeout(function(){
    location.href="http://www.google.com";
}, 10 * 1000);

If this is not what you're looking for, or you have other questions- do feel free to ask

from timecircles.

2braincells2go avatar 2braincells2go commented on July 19, 2024

Thank you for your input!

Yes it is simple for many, but as a 60 year old man who just started learning all this few years back, not so simple:)

If it were you adding:

$("#Countdown").TimeCircles().addListener(function(unit, value, total) {
if(total == -10) {
location.href="http://www.google.com";
}
});

Where would you place this code? Sorry for basic questions, but the only way to learn is ask.

Thank you once again and sorry to reopen.

from timecircles.

wimbarelds avatar wimbarelds commented on July 19, 2024

No problem at all!

the code is javascript, and should be executed when the page is done loading.

If you put the following right above the </body> part of your code, it should work

<script type="text/javascript">
    $(function(){
        $("#Countdown").TimeCircles().addListener(function(unit, value, total) {
            if(total == -10) {
                location.href="http://www.google.com";
            }
        });
    });
</script>

from timecircles.

2braincells2go avatar 2braincells2go commented on July 19, 2024

Perfect! That is what I thought but wanted to make sure.

Top of the day to you and wish you a great weekend.

from timecircles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.