{"action":"opened","issue":{"url":"https://api.github.com/repos/pixelcog/parallax.js/issues/267","repository_url":"https://api.github.com/repos/pixelcog/parallax.js","labels_url":"https://api.github.com/repos/pixelcog/parallax.js/issues/267/labels{/name}","comments_url":"https://api.github.com/repos/pixelcog/parallax.js/issues/267/comments","events_url":"https://api.github.com/repos/pixelcog/parallax.js/issues/267/events","html_url":"https://github.com/pixelcog/parallax.js/issues/267","id":348465964,"node_id":"MDU6SXNzdWUzNDg0NjU5NjQ=","number":267,"title":"Updating parallax src image doesn't work without reloading of page","user":{"login":"DeeptiMota","id":3839500,"node_id":"MDQ6VXNlcjM4Mzk1MDA=","avatar_url":"https://avatars3.githubusercontent.com/u/3839500?v=4","gravatar_id":"","url":"https://api.github.com/users/DeeptiMota","html_url":"https://github.com/DeeptiMota","followers_url":"https://api.github.com/users/DeeptiMota/followers","following_url":"https://api.github.com/users/DeeptiMota/following{/other_user}","gists_url":"https://api.github.com/users/DeeptiMota/gists{/gist_id}","starred_url":"https://api.github.com/users/DeeptiMota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeeptiMota/subscriptions","organizations_url":"https://api.github.com/users/DeeptiMota/orgs","repos_url":"https://api.github.com/users/DeeptiMota/repos","events_url":"https://api.github.com/users/DeeptiMota/events{/privacy}","received_events_url":"https://api.github.com/users/DeeptiMota/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-07T19:59:54Z","updated_at":"2018-08-07T19:59:54Z","closed_at":null,"author_association":"NONE","body":"Hi There,\r\n\r\nI have implemented parallax effect in the top header (~400px) of my website and have an functionality to change that banner image by browsing a new image.\r\n\r\nTo achieve the same, I need to store the browsed file address locally, need to reload the page and then set the stored image file while loading of the age. Code:\r\n\r\n    <script>\r\n    if (bannerImgBrowser.value == \"\" || bannerImgBrowser.value == null || bannerImgBrowser.value == undefined) {\r\n        bannerPic.setAttribute('data-image-src', '../img/banner_profile.jpg');\r\n    } else {\r\n        bannerPic.setAttribute('data-image-src', localStorage.getItem('browsedImgSrc'));\r\n    }\r\n    \r\n    $(\"body\").delegate(\"#banner_img\", \"change\", function(event) {\r\n        var reader = new FileReader();\r\n        reader.onload = function(e) {\r\n            localStorage.setItem('browsedImgSrc', e.target.result);\r\n            location.reload();\r\n        }\r\n        var file = event.target.files[0];\r\n        reader.readAsDataURL(file);\r\n    });\r\n    </script>\r\n\r\nCan't it be achieved simply, without reload()?"}}
{"actor":{"display_login":"DeeptiMota"}}