인벤 스크립트 게시판

전체보기

모바일 상단 메뉴

본문 페이지

[문의] 스크립트 변환 부탁드립니다

네임리스원
댓글: 1 개 관리자 댓글
조회: 740
2018-01-30 18:01:14
미리보기에서는 잘 나오는데 저장하면 전부 망가지고 그후로는 미리보기도 엉망이 되네요


<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>clock</title>
  <style>
#clock { position:relative;width:300px;height:300px; }
#clock img { position:absolute;top:0;left:0; }
#digital { width:300px; height:20px; text-align:center; }
}
  </style>
 </head>
 <body>
<div id="clock">
<img src="https://i.imgur.com/RarwHBl.png">
<img id="hour" src="https://i.imgur.com/LI384RS.png">
<img id="munite" src="https://i.imgur.com/WBzxVSd.png">
<img id="second" src="https://i.imgur.com/S0TGM6D.png">
</div>
<div id="digital"></div>
<script>
function digital() 
{
var d = new Date(); 
var h = d.getHours(); 
var m = d.getMinutes(); 
var s = d.getSeconds(); 
if( h > 12 ) h = h - 12; 
var dh = ( h * 30 ) + ( m / 2 ); 
dh = parseInt( dh ); 
var dm = m * 6; 
var ds = s * 6; 
 
document.getElementById("hour").style.transform = "rotate(" + dh + "deg)";
document.getElementById("munite").style.transform = "rotate(" + dm + "deg)";
document.getElementById("second").style.transform = "rotate(" + ds + "deg)";
document.getElementById("hour").style.MsTransform = "rotate(" + dh + "deg)";
document.getElementById("munite").style.MsTransform = "rotate(" + dm + "deg)";
document.getElementById("second").style.MsTransform = "rotate(" + ds + "deg)";
document.getElementById("hour").style.WebkitTransform = "rotate(" + dh + "deg)";
document.getElementById("munite").style.WebkitTransform = "rotate(" + dm + "deg)";
document.getElementById("second").style.WebkitTransform = "rotate(" + ds + "deg)";
 
document.getElementById("digital").innerHTML = h + ":" + m + ":" + s;
}
 
var timer = setInterval( function(){ digital(); }, 1000);
</script>
 </body>
</html>

Lv88 네임리스원

모바일 게시판 하단버튼

댓글

새로고침
새로고침

모바일 게시판 하단버튼

지금 뜨는 인벤

더보기+

모바일 게시판 리스트

모바일 게시판 하단버튼

글쓰기

모바일 게시판 페이징

AD