This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 原生js api 選擇器 | |
const btnChange = document.querySelectorAll('.btn-change-content'); | |
for (let index = 0; index < btnChange.length; index++) { | |
// 綁定 addEventListener | |
btnChange.item(index).addEventListener('click', function () { | |
// this.innerHTML -> 選到的html DOM 內容 ( class="this.innerHTML" ) | |
// 取btn區塊 html DOM | |
let domBtn = this.parentNode.parentNode.nextElementSibling; | |
// console.log(domBtn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 原生 js api 寫 click事件 | |
// 取個變數,比較短 | |
const btnChange = document.querySelectorAll('.btn-change-content'); | |
// 如果直接取 document.querySelector ,取到第一個就會回傳,詳細看 MDN | |
// 如果直接用 querySelectorAll ,直接 '點' ( document.querySelectorAll. ) 會找不到可以用的方法(methods) | |
// 要取 .item() 指定才有方法可以用,所以把 item()寫進迴圈全部取進來。 | |
for (let index = 0; index < btnChange.length; index++) { | |
//addEventListener事件監聽器 , 可以去找看看 click 和 onclick 有什麼不一樣 | |
btnChange.item(index).addEventListener('click', function () { | |
// classList 直接有方法可以取用 不過 ie支援度 ... :( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$grid-end: 8; | |
$gutter: 30px; | |
* { | |
box-sizing: border-box; | |
} | |
.container { | |
max-width: 960px; | |
margin: 0 auto; | |
} | |
.box { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- [TypeScript 特色與歷史簡介](https://oomusou.io/typescript/intro/) | |
- [TypeScript 之基本型別](https://oomusou.io/typescript/basic-type/) | |
- [TypeScript 之變數宣告與建立](https://oomusou.io/typescript/variable/) | |
- [TypeScript 之 Function](https://oomusou.io/typescript/function/) | |
- [TypeScript 之 Arrow Function](https://oomusou.io/typescript/arrow-function/) | |
- [TypeScript 之 Module](https://oomusou.io/typescript/module/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-02-23T07:21:31.947Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('name'[,deps],function) | |
// gulp.task 宣告任務 | |
// name : 命名 | |
gulp.task('hello',function(){ | |
console.log('Hello world!'); | |
}) |
NewerOlder