PIXNET Logo登入

Bug倉庫 // 程式日記

跳到主文

Bug倉庫 // 程式日記已經搬家到 https://bugswarehouse.blogspot.tw/ 了喔

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 8月 31 週四 201723:32
  • 用js寫一個時鐘,用Date物件


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function showTime(){
var today = new Date();
var hour=
parseInt(today.getHours())<10
? '0'+today.getHours()
: today.getHours();
var min=
parseInt(today.getMinutes())<10
? '0'+today.getMinutes()
: today.getMinutes();
var sec=
parseInt(today.getSeconds())<10
? '0'+today.getSeconds()
: today.getSeconds();
document.getElementById('nowtime').innerHTML=hour+':'+min+':'+sec
}
window.onload=function(){
setInterval(showTime,1000);
var today = new Date();
document.getElementById('nowdate').textContent=
today.getFullYear()+'/'+
(today.getMonth()+1)+'/'+
today.getDate()+'/'+
'星期'+today.getDay()
}
</script>
</head>
<body>
<h2>現在日期:<span id="nowdate"></span></h2>
<h2>現在時間:<span id="nowtime"></span></h2>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Javascript
▲top
  • 8月 31 週四 201723:32
  • 用js寫一個時鐘,用Date物件


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
function showTime(){
var today = new Date();
var hour=
parseInt(today.getHours())<10
? '0'+today.getHours()
: today.getHours();
var min=
parseInt(today.getMinutes())<10
? '0'+today.getMinutes()
: today.getMinutes();
var sec=
parseInt(today.getSeconds())<10
? '0'+today.getSeconds()
: today.getSeconds();
document.getElementById('nowtime').innerHTML=hour+':'+min+':'+sec
}
window.onload=function(){
setInterval(showTime,1000);
var today = new Date();
document.getElementById('nowdate').textContent=
today.getFullYear()+'/'+
(today.getMonth()+1)+'/'+
today.getDate()+'/'+
'星期'+today.getDay()
}
</script>
</head>
<body>
<h2>現在日期:<span id="nowdate"></span></h2>
<h2>現在時間:<span id="nowtime"></span></h2>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(474)

  • 個人分類:Javascript
▲top
  • 8月 31 週四 201722:31
  • SVG轉成FONT供CSS操作fontello

undefined

 
http://fontello.com/
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(70)

  • 個人分類:CSS工具
▲top
  • 8月 31 週四 201722:31
  • SVG轉成FONT供CSS操作fontello

undefined

 
http://fontello.com/
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:CSS工具
▲top
  • 8月 31 週四 201720:56
  • Autoprefixer CSS 自動加前綴工具(以符合各瀏覽器)

undefined

 
https://autoprefixer.github.io/
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:CSS工具
▲top
  • 8月 31 週四 201720:56
  • Autoprefixer CSS 自動加前綴工具(以符合各瀏覽器)

undefined

 
https://autoprefixer.github.io/
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(388)

  • 個人分類:CSS工具
▲top
  • 8月 30 週三 201723:05
  • 在function裡面寫物件的屬性/比較使用bind


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function Person(height,weight){
this.height=height; /*在function裡面定義物件屬性*/
this.weight=weight;
}
var Amy=new Person(160,40);
document.write(Amy.height+' '+Amy.weight);
</script>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(3)

  • 個人分類:Javascript
▲top
  • 8月 30 週三 201723:05
  • 在function裡面寫物件的屬性/比較使用bind


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function Person(height,weight){
this.height=height; /*在function裡面定義物件屬性*/
this.weight=weight;
}
var Amy=new Person(160,40);
document.write(Amy.height+' '+Amy.weight);
</script>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Javascript
▲top
  • 8月 30 週三 201721:15
  • js的map是幹嘛的


/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #f8f8f2;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.function {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function add1(aa){
return aa+1;
}
var arr=[0,1,2,3];
document.write(arr.map(add1));
</script>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Javascript
▲top
  • 8月 30 週三 201721:15
  • js的map是幹嘛的


/* http://prismjs.com/download.html?themes=prism-okaidia&languages=markup+css+clike+javascript */
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #f8f8f2;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.function {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
function add1(aa){
return aa+1;
}
var arr=[0,1,2,3];
document.write(arr.map(add1));
</script>
</body>
</html>
(繼續閱讀...)
文章標籤

Jerry 發表在 痞客邦 留言(0) 人氣(7)

  • 個人分類:Javascript
▲top
«1...353637»

文章搜尋

文章搜尋

文章分類

toggle 伺服器架設 (1)
  • AWS (2)
toggle 伺服器架設 (1)
  • AWS (2)
toggle 前端框架 (2)
  • Vue.js (26)
  • Angular.js (2)
toggle 前端框架 (2)
  • Vue.js (26)
  • Angular.js (2)
toggle HTML與開發工具 (2)
  • HTML (2)
  • 開發工具相關 (8)
toggle HTML與開發工具 (2)
  • HTML (2)
  • 開發工具相關 (8)
toggle CSS與framework (4)
  • CSS (9)
  • Bootstrap (26)
  • CSS插件 (1)
  • CSS工具 (3)
toggle CSS與framework (4)
  • CSS (9)
  • Bootstrap (26)
  • CSS插件 (1)
  • CSS工具 (3)
toggle JS與函式庫 (3)
  • js套件 (1)
  • jQuery (28)
  • Javascript (46)
toggle JS與函式庫 (3)
  • js套件 (1)
  • jQuery (28)
  • Javascript (46)
toggle 後端框架 (1)
  • Laravel (26)
toggle 後端框架 (1)
  • Laravel (26)
  • 自學資源 (1)
  • 自學資源 (1)
  • 未分類文章 (1)

文章分類

toggle 伺服器架設 (1)
  • AWS (2)
toggle 伺服器架設 (1)
  • AWS (2)
toggle 前端框架 (2)
  • Vue.js (26)
  • Angular.js (2)
toggle 前端框架 (2)
  • Vue.js (26)
  • Angular.js (2)
toggle HTML與開發工具 (2)
  • HTML (2)
  • 開發工具相關 (8)
toggle HTML與開發工具 (2)
  • HTML (2)
  • 開發工具相關 (8)
toggle CSS與framework (4)
  • CSS (9)
  • Bootstrap (26)
  • CSS插件 (1)
  • CSS工具 (3)
toggle CSS與framework (4)
  • CSS (9)
  • Bootstrap (26)
  • CSS插件 (1)
  • CSS工具 (3)
toggle JS與函式庫 (3)
  • js套件 (1)
  • jQuery (28)
  • Javascript (46)
toggle JS與函式庫 (3)
  • js套件 (1)
  • jQuery (28)
  • Javascript (46)
toggle 後端框架 (1)
  • Laravel (26)
toggle 後端框架 (1)
  • Laravel (26)
  • 自學資源 (1)
  • 自學資源 (1)
  • 未分類文章 (1)

最新文章

  • 部落格搬家囉! 網址:https://bugswarehouse.blogspot.tw/
  • 部落格搬家囉! 網址:https://bugswarehouse.blogspot.tw/
  • 用vue寫出:有頁碼表格,可排序,搜尋,限制出現之資料
  • 用vue寫出:有頁碼表格,可排序,搜尋,限制出現之資料
  • 使用laravel內建的vue componet
  • 使用laravel內建的vue componet
  • Vuetify
  • Vuetify
  • VS code安裝後相關
  • VS code安裝後相關

最新文章

  • 部落格搬家囉! 網址:https://bugswarehouse.blogspot.tw/
  • 部落格搬家囉! 網址:https://bugswarehouse.blogspot.tw/
  • 用vue寫出:有頁碼表格,可排序,搜尋,限制出現之資料
  • 用vue寫出:有頁碼表格,可排序,搜尋,限制出現之資料
  • 使用laravel內建的vue componet
  • 使用laravel內建的vue componet
  • Vuetify
  • Vuetify
  • VS code安裝後相關
  • VS code安裝後相關

個人資訊

Jerry
暱稱:
Jerry
分類:
數位生活
好友:
累積中
地區:

個人資訊

Jerry
暱稱:
Jerry
分類:
數位生活
好友:
累積中
地區:

文章精選

文章精選

熱門文章

  • (1,572)用vue寫購物車(小計、總計、數量計算)
  • (474)用js寫一個時鐘,用Date物件
  • (388)Autoprefixer CSS 自動加前綴工具(以符合各瀏覽器)
  • (44)過濾器,排列方式依據名稱字首,1與-1切換升冪與降冪
  • (43)createElement、createTextNode、appendChild,動態新增元素組合技
  • (13)Laravel,view視圖
  • (9)面試會考:寫出5的倍數的乘法表
  • (7)childNode和nodeValue,我的html是一棵樹,啊哩啊紮都是節點
  • (7)counter-increment與counter-rest,文章分段可用
  • (3)on綁定傳入四個參數,事件物件的type和data.自定義

熱門文章

  • (1,572)用vue寫購物車(小計、總計、數量計算)
  • (474)用js寫一個時鐘,用Date物件
  • (388)Autoprefixer CSS 自動加前綴工具(以符合各瀏覽器)
  • (44)過濾器,排列方式依據名稱字首,1與-1切換升冪與降冪
  • (43)createElement、createTextNode、appendChild,動態新增元素組合技
  • (13)Laravel,view視圖
  • (9)面試會考:寫出5的倍數的乘法表
  • (7)childNode和nodeValue,我的html是一棵樹,啊哩啊紮都是節點
  • (7)counter-increment與counter-rest,文章分段可用
  • (3)on綁定傳入四個參數,事件物件的type和data.自定義

最新留言

    最新留言

      動態訂閱

      動態訂閱

      誰來我家

      誰來我家

      參觀人氣

      • 本日人氣:
      • 累積人氣:

      參觀人氣

      • 本日人氣:
      • 累積人氣: