Selamat malam sobat yang suka begadang bermain coding, Sering terlihat di suatu website terdapat penghitungan waktu, nah di sini saya akan membahas tentang cara membuat souce code timer.1. Sobat harus download plugin yang akan digunakan.2. Masukan link yang di download seperti dibawah ini2 | < script type = "text/javascript" src = "js/kinetic.js" ></ script > |
3 | < script type = "text/javascript" src = "../jquery.final-countdown.js" ></ script > |
3. Include jga bostrap css 3.
4. Tulis struktur code seperti dibawah ini
01 | < div class = "countdown-container container" > |
02 | < div class = "clock row" > |
05 | < div class = "clock-item clock-days countdown-time-value col-sm-6 col-md-3" > |
08 | < div id = "canvas_days" class = "clock-canvas" ></ div > |
11 | < p class = "type-days type-time" >DAYS</ p > |
19 | < div class = "clock-item clock-hours countdown-time-value col-sm-6 col-md-3" > |
22 | < div id = "canvas_hours" class = "clock-canvas" ></ div > |
25 | < p class = "type-hours type-time" >HOURS</ p > |
32 | < div class = "clock-item clock-minutes countdown-time-value col-sm-6 col-md-3" > |
35 | < div id = "canvas_minutes" class = "clock-canvas" ></ div > |
38 | < p class = "type-minutes type-time" >MINUTES</ p > |
45 | < div class = "clock-item clock-seconds countdown-time-value col-sm-6 col-md-3" > |
48 | < div id = "canvas_seconds" class = "clock-canvas" ></ div > |
51 | < p class = "type-seconds type-time" >SECONDS</ p > |
5. Untuk CSSnya sebagai berikut
05 | background-image : url ( '../img/sample.jpg' ); |
06 | background-position : center center ; |
07 | background-repeat : no-repeat ; |
08 | background- size : cover; |
11 | background-color : rgba( 44 , 62 , 80 , 0.6 ); |
12 | background-image : url ( '../img/pattern.png' ); |
13 | background-position : center ; |
14 | background-repeat : repeat ; |
15 | font-family : 'Raleway' , 'Arial' , sans-serif ; |
20 | -webkit-transform: translateY( -50% ); |
21 | -moz-transform: translateY( -50% ); |
22 | transform: translateY( -50% ); |
31 | background-color : rgba( 255 , 255 , 255 , . 1 ); |
44 | text-shadow : 1px 1px 1px rgba( 0 , 0 , 0 , 1 ); |
53 | @media ( min-width : 768px ) and ( max-width : 991px ) { |
58 | @media ( max-width : 767px ) { |
60 | margin : 0px 30px 30px 30px ; |
6. Java Script Jangan liupa ditambahkan js ini berfungsi untuk menghitung durasi waktu yang diinginklan
1 | <script type= "text/javascript" > |
2 | $( '.countdown' ).final_countdown({ |
Cukup sekian tutorial dari saya, mungkin teman-teman masih binggung ya , langsung download aja di link http://destyy.com/q13gL8 atau di http://viahold.com/2ITM tapi jangala lupa share kepada yang membutuhkan. terimakasih