Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to change background image dynamically in react

render: function() {
  var divImage = {
    backgroundImage : "url(" + this.state.song.imgSrc + "),url(" + this.state.nextImgSrc + ");" 
  };

  return (
    <li>
      <div ref="image-pane" className="player" style={divImage}></div>
    </li>
  )
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #background #image #dynamically #react
ADD COMMENT
Topic
Name
4+9 =