diff --git a/src/js/components/Parallax.js b/src/js/components/Parallax.js index 61589845..0b4d53e7 100755 --- a/src/js/components/Parallax.js +++ b/src/js/components/Parallax.js @@ -56,7 +56,7 @@ export default class Parallax extends React.Component{ } componentWillReceiveProps( nextProps ){ - if( ( !this.state.url || nextProps.image != this.state.url ) && !this._loading ){ + if( ( !this.state.url || nextProps.image != this.state.url ) && !this._loading && nextProps.image ){ this._loading = true this.setState({ url: nextProps.image, image: false, loading: true }) this.loadImage( nextProps.image ) @@ -109,6 +109,7 @@ export default class Parallax extends React.Component{ } updateCanvas( image ){ + var canvasWidth = $('.parallax').outerWidth(); var canvasHeight = $('.parallax').outerHeight(); if( this.state.canvas.width != canvasWidth || this.state.canvas.height != canvasHeight ){