2
我試圖顯示一個疊加當某個輸入字段被點擊。我正在做這個反應。我怎樣才能做到這一點?當輸入被點擊時顯示一個疊加
這是我的代碼
import React, { Component } from 'react';
import cam from '../../Resources/img/cam.png';
import SinglePost from '../../Components/Post/single_post';
class Middle extends Component {
constructor(props) {
super(props);
this.state = {
posts: []
}
}
render() {
function popup_ques(e) {
e.preventDefault();
alert("now the overlay should appear");
}
return (
<div className="middle_div">
<input className='post_data_input' placeholder="Ask your question here" ref="postTxt" onClick={popup_ques}/>
</div>
);
}
}
export default Middle;
什麼是我應該採取的辦法?
能否請您給我如何創建覆蓋的例子嗎? – CraZyDroiD
@CraZyDroiD https://tympanus.net/codrops/2013/11/07/css-overlay-techniques/ http://codepen.io/felicia/pen/qKhJt http://stackoverflow.com/questions/9724035/如何燦一個創建-的疊加功能於CSS –