This file contains hidden or 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
| <!Doctype html> | |
| <html> | |
| <title> | |
| the very easy way to show the event bubble | |
| </title> | |
| <body> | |
| <div id="button"> | |
| <button id="1">1</button> | |
| <button id="2">2</button> | |
| <button id="3">3</button> |
This file contains hidden or 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
| .container{ | |
| display:table; | |
| } | |
| .cell1{ | |
| display:table-cell; | |
| border:solid 2px black | |
| } | |
| .cell2{ | |
| display:table-cell; | |
| border:solid 2px black; |
This file contains hidden or 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
| /*@zhangolve 2017/03/13*/ | |
| /*我们注意到假如我们给这个盒子中每个div设置宽度为800px,也就是说总的主轴长度应该大于3200px了, | |
| 这个时候超过了屏幕的宽度,会出现一个overflow-x的滑块,这也在说明着这个伸缩盒子可以无限延伸,只要伸缩项目在伸缩盒子之内*/ | |
| div>div { | |
| border:1px solid black; | |
| width:800px; | |
| height:200px; | |
| text-align:center; | |
| line-height:100px; |
This file contains hidden or 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
| //https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md | |
| function add(xPromise,yPromise) { | |
| // `Promise.all([ .. ])` takes an array of promises, | |
| // and returns a new promise that waits on them | |
| // all to finish | |
| return Promise.all( [xPromise, yPromise] ) | |
| // when that promise is resolved, let's take the | |
| // received `X` and `Y` values and add them together. | |
| .then( function(values){ |
This file contains hidden or 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
| /*very simple react carousel*/ | |
| /*zhangolve */ | |
| import React, { Component } from 'react'; | |
| export default class Craspaul extends React.Component{ | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| //image:['https://ununsplash.imgix.net/uploads/141223808515744db9995/3361b5e1?q=75&fm=jpg&w=602','https://unsplash.imgix.net/photo-1415356838286-df6fd593e8b3?q=75&fm=jpg&w=600','https://ununsplash.imgix.net/reserve/JaI1BywIT5Or8Jfmci1E_zakopane.jpg?q=75&fm=jpg&w=600'], | |
| current:0 |
This file contains hidden or 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
| /*very simple react carousel*/ | |
| /*zhangolve */ | |
| class Test extends React.Component{ | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| image:['https://ununsplash.imgix.net/uploads/141223808515744db9995/3361b5e1?q=75&fm=jpg&w=602','https://unsplash.imgix.net/photo-1415356838286-df6fd593e8b3?q=75&fm=jpg&w=600','https://ununsplash.imgix.net/reserve/JaI1BywIT5Or8Jfmci1E_zakopane.jpg?q=75&fm=jpg&w=600'], | |
| current:0 | |
| }; | |
This file contains hidden or 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
| <div class="container"> | |
| <div class="inner"> | |
| </div> | |
| </div> |
This file contains hidden or 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
| <div id="first"> | |
| <p>first</p> | |
| </div> | |
| <div id="second"> | |
| <p>second</p> | |
| </div> | |
| <div id="third"> | |
| <p id="content">third99</p> |
This file contains hidden or 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
| <div id="first" ></div> | |
| <div id="second" >222222</div> |
This file contains hidden or 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
| var data='col1,col2\nval1,val2'; | |
| var a = document.createElement('a'); | |
| a.href = 'data:application/gkl;charset=utf-8,' + encodeURIComponent(data); | |
| //supported by chrome 14+ and firefox 20+ | |
| a.download = 'data.gkl'; | |
| //needed for firefox | |
| document.getElementsByTagName('body')[0].appendChild(a); | |
| //supported by chrome 20+ and firefox 5+ | |
| a.click(); |