it's weird when I try to change the style of this section by changing state when user mouseOver button. The content of h1 tag is changed but style of the section isn't. Could someone help me on that?
export class Jumbotron extends Component {
constructor (props) {
super(props)
this.state = {
style: {
backgroundImage: 'none'
}
}
this.handleSubjectMouseOver = this.handleSubjectMouseOver.bind(this)
}
handleSubjectMouseOver (bg) {
console.log(bg)
this.setState({
style: {
backgroundImage: bg
}
})
}
render () {
return <section className="jumbotron container" style=
{this.state.style}>
<h1>{this.state.style}</h1>
<div className="jumbotron-content">
<h2 style={{marginBottom: 3, marginTop: 40}}>Learning is fun with
LIVE</h2>
<div style={{marginLeft: 10}}>Body ........</div>
<div style={{marginBottom: 20, marginTop: 80}}
className="subjects-title">TOP CLASSES, TUTORIAL & TIPS TO EXCEL IN:
</div>
<div className="subjects" style={{backgroundImage: this.state.background}}>
<RaisedButton label="MATH" secondary onMouseMove={() => { this.handleSubjectMouseOver(mathBg) }} />
<RaisedButton label="PHYSICS" secondary onMouseMove={() => { this.handleSubjectMouseOver(physicBg) }} />
<RaisedButton label="CHEMISTRY" secondary onMouseMove={() => { this.handleSubjectMouseOver(chemistryBg) }} />
<RaisedButton label="BIOLOGY" secondary onMouseMove={() => { this.handleSubjectMouseOver(biologyBg) }} />
<RaisedButton label="COMP SCIENCE" secondary
onMouseMove={() => { this.handleSubjectMouseOver(computerBg) }} />
</div>
</div>
</section>
}