asyncguo

Results 49 comments of asyncguo
trafficstars

[demo](https://codepen.io/asyncguo/pen/RzGBLx?editors=0010) ```js (() => { let oDiv = document.createElement('div') oDiv.style.width = '150px' oDiv.style.height = '300px' oDiv.style.background = 'linear-gradient(to right bottom, red, blue)' document.body.appendChild(oDiv) let num = 0 function aniGradient ()...

```css #overlay:target { display: block; } #overlay { height: 100vh; background-color: rgba(0, 0, 0, 0.2); } ``` ```js let overlay = document.getElementById("overlay"); let showButton = document.getElementById("showButton"); showButton.addEventListener("click", () => {...

```js // 1 document.querySelectorAll('a') // 2 document.querySelectorAll('*[href]') // 3 let links = [...document.querySelectorAll('*[href]')] // 1) links.forEach((item, index) => { if (item.href.startsWith('javascript:')) { item.setAttribute('role', 'button') } }) // 2) links.forEach((item, index)...

1. 方法1(IE8+) ```css .quiz { display:table } .quiz-h { vertical-align: middle; padding: 0 8px 0 10px; } .quiz-p { vertical-align: middle; padding: 0 10px 0 8px; text-align: justify; } ```...

1. styleSheets 2. head textContent 3. nth-of-type 4. nth-child(3) 5. 3 6. nth-last-of-type(2) 7. | 8. not

```js // 第一题 function titleAddEllipsis(str) { let strArr = [...str]; return strArr.length > 15 ? `${strArr.slice(0, 6).join("")}...${strArr.slice(-6).join("")}` : str; } // 第二题 function filenameAddEllipsis(str) { let strArr = [...str]; if...

```js //zxx: 3,4测试不通过 const toCamelCase = (letter) => letter.replace(/([-]+)(.)/g, (_, p1, p2, offset) => { return offset ? p2.toUpperCase() : p2 }) console.log(toCamelCase('abc-def-ghi')) const toDashJoin = (letter) => letter.replace(/([A-Z])/g, (_,...

```js // 第一题 strTel = strTel.trim() // 第二题 let strTel = '1234567890' let result = '' for (var i = 0; i < strTel.length; i++) { let nCode = strTel.charCodeAt(i);...

[demo](https://codepen.io/asyncguo/pen/GRKEbpd?editors=1100) ```html 标题 恭喜我们29个最老的测试版网站-他们现在不再是测试版了! 《独角兽动物园》35;7:Nicolas访谈 减少需要重新审查的封闭问题数量的建议 实验:在接下来的30天内(直到2019-09-07),以3票为基准关闭和重新打开提出的问题 ``` ```css dl, dd, p{ margin: 0; } dl{ width: 310px; border: 1px solid #e9e5d4; } .list-title{ padding: 12px 16px; font-size: 13px; font-weight:...

[demo](https://codepen.io/asyncguo/pen/PooJabR?editors=1010) ```js //zxx: 为何我拖了没效果出现 ``` ```html ``` ```js let imageWrapper = document.getElementById('imageWrapper') let dialogBox = document.getElementById('dialogBox') let previewImage = document.getElementById('previewImage') let dragEl = null let dragElIndex = null imageWrapper.addEventListener('click', e...