0
divを上から表示して、下に移動しようとしています。 CSSのトランジションを使用して同様の効果を得ました。しかし、ボタンをクリックするとdiv遷移が起こりたい。私はreactjsでこれをコーディングしています。クリック時のdivのCSSトランジション
私はときに私私はbutton.Onlyをクリックしたときに私のdivが表示されます
.notification_div {
width: 100%;
height: 0;
background-color: whitesmoke;
margin-bottom: 20px;
border-radius: 5px;
}
.notification_div:active {
transition: height 1s;
height: 100%;
}
を適用している。この
私のdiv
<div className="notification_div">
<span className="small_font notification_header">Notifications</span>
<div className="notification_item_div">
<span className="notification_item">Test Notification</span>
</div>
<div className="notification_item_div">
<span className="notification_item">Test Notification</span>
</div>
<div className="notification_item_div">
<span className="notification_item">Test Notification</span>
</div>
</div>
CSSのようなものを行っていますdivをクリックすると、移行が始まります。私はdivが最初に現れるときに移行が起こるようにしたい。
どうすればいいですか?
この私はよくかかわらず、あなたが何をしようとして効果のreactjs
class App extends Component {
constructor(props) {
super(props);
this.state = {
showNotification: false,
};
this.open_notification = this.open_notification.bind(this);
}
open_notification() {
this.setState({
showNotification: !this.state.showNotification,
});
}
'.notification_div:active'は、要素がクリックされたときにのみCSSが適用されることを意味します。 –
はい、私はそれを認識しています。私は私のdivが表示されたら、移行をしたい。クリックしていない。 – CraZyDroiD
あなたのCSSは実際にあなたのdivの流れを上から下にしますか?高さを変更してもdivの位置は変わらないはずです –