
Penerapan Jam Digital dengan jQuery
Meskipun kita sering dirumah ketika dalam keadaan nge-Net yang selalu tersanding oleh jam atau waktu. Gak ada salahnya untuk kita meneksperiment dalam pernerapan jam pada design blog yang Anda miliki. Seperti halnya penerapan CSS
, jQuery
dan HTML
yang biasa dilakukan dengan bermacam cara, bisa Anda lihat dan pelajarinya disini.
Hasilnya :
1code-line:1-12code-line:1-23code-line:1-34code-line:1-45code-line:1-56code-line:1-67code-line:1-78code-line:1-89code-line:1-910code-line:1-1011code-line:1-1112code-line:1-1213code-line:1-1314code-line:1-1415code-line:1-1516code-line:1-1617code-line:1-1718code-line:1-1819code-line:1-1920code-line:1-2021code-line:1-2122code-line:1-2223code-line:1-2324code-line:1-2425code-line:1-2526code-line:1-2627code-line:1-2728code-line:1-2829code-line:1-2930code-line:1-3031code-line:1-3132code-line:1-3233code-line:1-3334code-line:1-3435code-line:1-3536code-line:1-3637code-line:1-3738code-line:1-3839code-line:1-3940code-line:1-4041code-line:1-4142code-line:1-4243code-line:1-4344code-line:1-4445code-line:1-4546code-line:1-4647code-line:1-4748code-line:1-4849code-line:1-4950code-line:1-5051code-line:1-5152code-line:1-5253code-line:1-5354code-line:1-5455code-line:1-5556code-line:1-5657code-line:1-5758code-line:1-5859code-line:1-5960code-line:1-6061code-line:1-6162code-line:1-6263code-line:1-6364code-line:1-6465code-line:1-6566code-line:1-6667code-line:1-6768code-line:1-6869code-line:1-6970code-line:1-7071code-line:1-7172code-line:1-7273code-line:1-7374code-line:1-7475code-line:1-7576code-line:1-7677code-line:1-7778code-line:1-7879code-line:1-79/* Make font-face */
@font-face {
font-family:'BebasNeueRegular';
src:url('BebasNeue-webfont.eot');
src:url('BebasNeue-webfont.eot?#iefix') format('embedded-opentype'),url('BebasNeue-webfont.woff') format('woff'),url('BebasNeue-webfont.ttf') format('truetype'),url('BebasNeue-webfont.svg#BebasNeueRegular') format('svg');
font-weight:normal;
font-style:normal;
}
/* Design Clock */
.container {
width:960px;
margin:0 auto;
overflow:hidden;
}
.clock {
width:800px;
margin:0 auto;
padding:30px;
border:1px solid #333;
color:#fff;
}
#Date {
font-family:'BebasNeueRegular',Arial,Helvetica,sans-serif;
font-size:36px;
text-align:center;
text-shadow:0 0 5px #00c6ff;
}
ul {
width:800px;
margin:0 auto;
padding:0;
list-style:none;
text-align:center;
}
ul li {
display:inline;
font-size:10em;
text-align:center;
font-family:'BebasNeueRegular',Arial,Helvetica,sans-serif;
text-shadow:0 0 5px #00c6ff;
}
#point {
position:relative;
-moz-animation:mymove 1s ease infinite;
-webkit-animation:mymove 1s ease infinite;
padding-left:10px;
padding-right:10px;
}
/* Simple Animation */
@-webkit-keyframes mymove {
0% {
opacity:1.0;
text-shadow:0 0 20px #00c6ff;
}
50% {
opacity:0;
text-shadow:none;
}
100% {
opacity:1.0;
text-shadow:0 0 20px #00c6ff;
}
}
@-moz-keyframes mymove {
0% {
opacity:1.0;
text-shadow:0 0 20px #00c6ff;
}
50% {
opacity:0;
text-shadow:none;
}
100% {
opacity:1.0;
text-shadow:0 0 20px #00c6ff;
}
}
1code-line:2-12code-line:2-23code-line:2-34code-line:2-45code-line:2-56code-line:2-67code-line:2-78code-line:2-89code-line:2-910code-line:2-1011code-line:2-1112code-line:2-1213code-line:2-1314code-line:2-1415code-line:2-1516code-line:2-1617code-line:2-1718code-line:2-1819code-line:2-1920code-line:2-2021code-line:2-2122code-line:2-2223code-line:2-2324code-line:2-2425code-line:2-2526code-line:2-2627code-line:2-2728code-line:2-2829code-line:2-2930code-line:2-3031code-line:2-3132code-line:2-3233code-line:2-3334code-line:2-3435code-line:2-3536code-line:2-36<script type="text/javascript" src="https://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Create two variable with the names of the months and days in an array
var monthNames = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"];
var dayNames = ["Minggu,", "Senin,", "Selasa,", "Rabu,", "Kamis,", "Jumat,", "Sabtu,"]
// Create a newDate() object
var newDate = new Date();
// Extract the current date from Date object
newDate.setDate(newDate.getDate());
// Output the day, date, month and year
$('#Date').html(dayNames[newDate.getDay()] + " " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear());
setInterval(function() {
// Create a newDate() object and extract the seconds of the current time on the visitor's
var seconds = new Date().getSeconds();
// Add a leading zero to seconds value
$("#sec").html((seconds < 10 ? "0" : "") + seconds);
}, 1000);
setInterval(function() {
// Create a newDate() object and extract the minutes of the current time on the visitor's
var minutes = new Date().getMinutes();
// Add a leading zero to the minutes value
$("#min").html((minutes < 10 ? "0" : "") + minutes);
}, 1000);
setInterval(function() {
// Create a newDate() object and extract the hours of the current time on the visitor's
var hours = new Date().getHours();
// Add a leading zero to the hours value
$("#hours").html((hours < 10 ? "0" : "") + hours);
}, 1000);
});
</script>
1code-line:3-12code-line:3-23code-line:3-34code-line:3-45code-line:3-56code-line:3-67code-line:3-78code-line:3-89code-line:3-910code-line:3-10<div class="clock">
<div id="Date"></div>
<ul>
<li id="hours"></li>
<li id="point">:</li>
<li id="min"></li>
<li id="point">:</li>
<li id="sec"></li>
</ul>
</div>
Anda bisa liat yang sudah dimodifikasi oleh Admin di ⇒ https://experimenkoe.blogspot.com/
4 comments