共 35 篇文章 |
|
Copyul>li.item${item number:$}*3<ul> <li class="item1">item number:1</li> <li class="item2">item number:2</li> <li class="item3">item number:3</li></ul>Copyul>li.item$@-*3=><ul> <li class="item3"></li> &l... 阅275 转1 评0 公众公开 19-05-28 16:53 |
grid屬性是grid-template-rows、grid-template-columns、grid-template-areas、 grid-auto-rows、grid-auto-columns、grid-auto-flow這六個屬性的合併簡寫形式。grid-column屬性是grid-column-start和grid-column-end的合併簡寫形式,grid-row屬性是grid-row-start屬性和grid-row-end的合併簡寫形式。grid-area屬性還可用作grid-row-start、gri... 阅111 转0 评0 公众公开 19-04-25 17:59 |
採用 Flex 佈局的元素,稱為 Flex 容器(flex container),簡稱"容器"。flex-directionflex-wrapflex-flowjustify-contentalign-itemsalign-content3.1 flex-direction屬性。flex-flow屬性是flex-direction屬性和flex-wrap屬性的簡寫形式,默認值為row nowrap。orderflex-growflex-shrinkflex-basisflexalign-self4.1 order屬性。4.... 阅41 转0 评0 公众公开 17-12-30 19:14 |
我們來看看 UTF-8 具體是如何存儲字符的,如下面的字符。這個就是 UTF-8 的存儲特點,UTF 規定了每個字符的編號,而 UTF-8 定義了字符應該怎麼存儲。Base64 可以把原本 ASCII 碼的控制字符甚至 ASCII 碼之外的字符都轉成可打印的 6 bit 字符,也就是說用 6 bit 字符表達了原本 8 bit 字符。JavaScript 語言採用 Unicode 字符集,但是它編碼使用... 阅21 转0 评0 公众公开 17-12-30 14:53 |
Element.querySelector() Element.querySelectorAll() Element.getElementsByTagName() Element.getElementsByClassName()// 在該元素前插入 Element.insertAdjacentHTML(''''''''afterBegin'''''''', htmlString); // 在該元素第一個子元素前插入 Element.insertAdjacentHTM... 阅21 转0 评0 公众公开 17-12-25 10:11 |
// 直接調用fn而不設置this,通常(即不使用箭頭函數的情況)默認為全局對象,若在嚴格模式則為undefinedconsole.log(fn() === obj); // true // 但是注意,如果你只是引用obj的方法,而沒有調用它(this是在函數調用過程中設置的)var fn2 = obj.bar;// 那麼調用箭頭函數後,this指向window,因為它從 bar 繼承了this。在上面的例子中,一個賦值給... 阅30 转0 评0 公众公开 17-12-08 15:21 |
舍入捨去取整也非常常見,JavaScript 的 Math 對象中有明確的方法支持:1、四捨五入 Math.round(number)JavaScript 代碼:console.log(Math.floor(20.1)); // -> 20console.log(Math.floor(20.5)); // -> 20console.log(Math.floor(20.9)); // -> 20console.log(Math.floor(-20.1)); // -> -21console.log(Math.floor(-20.5)); // -... 阅161 转0 评0 公众公开 17-12-06 10:28 |
var randomIndex = Math.floor( objects.length * Math.random() );function updateRandom() { var p = Math.random(), n = Math.random() / 4;var objects = [ ''''''''登山包'''''''', ''''''''旅行箱'''''''... 阅26 转0 评0 公众公开 17-09-27 09:36 |
Hexo 博客搭建Hexo 主題選擇以及應用關於 Hexo Meterial 主題的相關配置網站 SEO 優化將你的網站同時託管到 Github 和 Coding 上,國內外分流將自己的代碼託管到私有倉庫使用 Gulp 來壓縮你的代碼如何簡單高效地使用七牛圖床。hexo init hexo_blog //在當前目錄下新建一個叫 hexo_blog 文件夾並在其中初始化生成 Hexo 相關代碼cd hexo_blog //進... 阅3466 转8 评0 公众公开 17-07-12 19:00 |
不過因為調用了構造函數,在Person有參數時此方法不太好使//僅ES5+支持Student.prototype = Object.create(Person.prototype);//Object.create的作用:創建以個空對象,並且這個空對象的原型指向傳入的參數,即Person.prototypeStudent.prototype.constructor = Person;if(!Object.create){//proto 為原型對象Object.create = function(proto){... 阅28 转0 评0 公众公开 17-06-08 19:19 |