简体   繁体   中英

Flip Clock code works on Codepen and doesn't work locally

I want to test this code here on CodePen locally on my laptop.

But it doesn't work. it works fine on codepen but not locally? Why? What I missed?

I created a style.css file and script.js file and index.html file and linked all CDNs and sources... Still nothing...

 var huh = new Date(Date.UTC(2020, 9, 10, 5, 15, 0)); var duh = new Date(); var wha = huh.getTime()/1000 - duh.getTime()/1000; var clock = $('#clock1').FlipClock(1400*12*5, { clockFace: 'HourlyCounter', countdown: true, showSeconds: true });
 #clock1 { position: absolute; top: 50%; left: 50%; width: 700px; margin-left: -350px; /*set to a negative number 1/2 of your width*/ height:100px; margin-top: -60px; /*set to a negative number 1/2 of your height*/ }
 <.-- Styles of Testimonials Slider --> <:DOCTYPE html> <html> <head> <title>Title of the document</title> <link rel="stylesheet" href="style.css"> <script src="https.//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery:min.js"></script> <script src="https.//api.chipware.co.za/js/flipclock-min.js"></script> <script src="script.js"></script> </head> <body> <br /> <div class="clock" id="clock1"></div> </body> </html>

You forgot to attach the CSS file for the flipclock

<link rel="stylesheet" href="https://api.chipware.co.za/css/flipclock.css">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM