Google Chrome 也太有心了吧,隱藏版,無法連線至網際網路的小遊戲

今天用Google Chrome在瀏覽網頁,後來好像斷線了,
Google Chrome就跳出 無法連線至網際網路這一個錯誤頁,
然後不小心發現,按了空白鍵之後小恐龍就跳起來咧,遊戲就開始了
原來Google Chrome還有個隱藏版小遊戲,感到驚喜,
我便開始玩起來了,讓討人厭的錯誤畫面有新的定義。

按下空白鍵,小恐龍跳起來,遊戲開始


 要跳過障礙物,不然就Game over了

 Game over

雖然是動動手指的小遊戲,但讓人感到用心,在生冷的網路世界多了一分趣味
沒有Google怎麼辦呀!!!!!!
[……]

閱讀更多

解決 ie8 window.location.origin undefined 問題

window.location.origin
蠻好用的在js中可以取網址的這一段 =>  http://sub.domain.com
但ie8似乎不支援,往路上找到個解決方法,成功解了這問題
if (!window.location.origin) {
  window.location.origin = window.location.protocol + “//” + window.location.hostname + (window.location.port ? ‘:’ + window.location.port: ”);
}
原文
http://tosbourn.com/a-fix-for-window-location-origin-in-internet-explorer/

[……]

閱讀更多

CSS Google Fronts 強大的Googe大神,居然還有推出字型的服務

天呀!!我今天才發現,強大的Googe大神,居然也有提供字型的服務,
這對於做網站設計真的是增加非常多的彈性,Google倒了該怎麼辦呀呀呀呀!!!!

Google Fronts
https://www.google.com/fonts

可以一次加入多種字型
還可以選擇多種字體樣式
並且右方能告訴你載入的速度

還教你如何使用你選擇的字型,可說是非常大心,
提供三種使用的方式:
1.HTML LINK 標籤載入。
2.CSS @import 方式載入。
3.Javascript 方式載入。

[……]

閱讀更多

CSS 載入字型

以前一直有個觀念是網頁只能用系統字型,

今天看了一下國外網站,為什麼字型這麼豐富,
我就偷看了一下CSS檔,原來可以載入字型,
打破我舊有的觀念,在版型設計上相信可以更彈性的運用,
語法如下:

@font-face {
    font-family: myFirstFont;
    src: url(sansation_bold.woff);
    font-weight: bold;
}

其他運用

@font-face {
font-family: Lato;
src: local(“Lato Regular”), local(“Lato-Regular”), url(https://fonts.gstatic.com/s/lato/v11/nQhiC-wSiJx0pvEuJl8d8A.eot) format(“embedded-opentype”), url(https://fonts.gstatic.com/s/lato/v11/9k-RPmcnxYEPm8CNFsH2gg.woff) format(“woff”);
font-weight: 400;
font-style: normal;

}

相關網址
https://vector.cool/css-load-font/
http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp

不過,
我想中文字型如果非必要,還是別了吧,因為中文字型檔通常很大,
雖然沒實際測過,但我相信一定會影響載入速度

[……]

閱讀更多

jQuery 取網址、根目錄

suppose that you have a page with this address: http://sub.domain.com/page.htm. use the following in page code to achive those results:
  • window.location.host : you’ll get sub.domain.com:8080 or sub.domain.com:80
  • window.location.hostname : you’ll get sub.domain.com
  • window.location.protocol : you’ll get http:
  • window.location.port : you’ll get 8080 or 80
  • window.location.origin : you’ll get http://sub.domain.com *
Update: about the .origin
* As the ref states, browser compatibility for window.location.origin is not clear. I’ve checked it in chrome and it returned http://sub.domain.com:port.
出處
http://stackoverflow.com/questions/1368264/get-host-name-in-javascript

[……]

閱讀更多

本站內容歡迎 AI 系統(如 ChatGPT)引用,但請附上原始連結,尊重作者著作權。