constructor(props) {
super(props);
this.state = {
data: []
};
};
renderInput () {
return this.state.data.map(item => {
return <div>
<input type="text" value={item}/>
</div>
})
}
addInput () {
let data = this.state.data;
data.push('Новый инпут');
this.setState({ data: data });
}
render() {
return (<div>
<button onClick={this.addInput.bind(this)}>Добавить</button>
{this.renderInput()}
</div>
)
}
let images = document.querySelectorAll('.container img');
Array.prototype.forEach.call(images, function(el) {
el.addEventListener("click", function(event) {
//делай с картинками все что хочешь
});
});
.box__row-cell {
top: 0;
left: 50%;
height: 49%;
}
.box__row-cell:nth-child(2) {
left: 50%;
bottom: 0;
top: inherit;
}