JaimeCheng

Results 39 comments of JaimeCheng
trafficstars

[>在线demo

[在线demo](https://codepen.io/JaimeCheng/pen/NWKOaMw?editors=1100) ```css .cover { position: relative; display: inline-block; } .cover img { width: 120px; height: 160px; } .tag { color: #fff; font-size: 12px; position: absolute; } .tag1 { padding: 4px...

```js // 1 var as = document.getElementsByTagName('a') // 2 var links = document.querySelectorAll('[href]'); // 3 links.forEach(el => { const val = el.getAttribute('href'); if (val.indexOf('javascript:') === 0) { el.setAttribute('role', 'button') }...

**方法一** ```css .quiz { display: table; } .quiz-h { vertical-align: middle; padding: 0 10px; margin: 0; } .quiz-p { text-align: justify; margin: 0 10px; } ``` **方法二** ```css .quiz {...

[demo预览](http://jsrun.net/qPXKp) 气泡的小尾巴,参考了[maomao1996](https://github.com/maomao1996) ```html 聊天布局 提案笙 9月30日 21:47 什么秘密,我觉得你现在跟我说什么都没有意义。 淮南王玲 10月8日 10:30 @蝴蝶蓝 优秀 蝴蝶蓝 昨天 22:13 值得一听~~ Y优秀X 刚刚 围观戏精现场 ``` ```css html, body { max-width: 540px; width: 100%; margin:...

```js // 1 function formatTitle (str) { return str.length

```js // 1 function toCamelCase (str) { return str.replace(/\-(\w)/g, function (all, letter) { return letter.toUpperCase(); }); } // 2 function toDashJoin (str) { return str.replace(/([A-Z])/g, "-$1").toLowerCase(); } // 3 function...

```js // 1 strTel = strTel.trim() // 2 strTel = toCDB(strTel) function toCDB(str) { var tmp = ''; for (var i = 0; i < str.length; i++) { if (str.charCodeAt(i)...

[在线demo](https://codepen.io/JaimeCheng/pen/RwbgpVw?editors=1100) ```css ul, li { list-style: none; padding: 0; margin: 0; } a { color: #0077CC; text-decoration: none; } .icon { width: 16px; height: 16px; margin-right: 6px; background-size: 100%; display:...

[>在线demo { const src = item.getAttribute('src') item.onclick = function () { imgPreview.setAttribute('src', src) dialog.showModal() } item.addEventListener('dragstart', handleStart, false) item.addEventListener('dragover', handleOver, false) item.addEventListener('drop', handleDrop, false) }) dialog.onclick = function () {...