Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Bartek Lewandowski
@Jabarlew
:D
its like we rush to much to get answers from others
and what we really need
is some time
:D
Hills
@Hillsie
:shipit: Sort of, I was scratching my head for about 2 hours and googling. As I posted the question, I tried a few things.
then tada... found a way
DecisiveIndecisive
@DecisiveIndecisive
Morning everyone
Markus Kiili
@Masd925
@DecisiveIndecisive Morning.
creator0323
@Amasian
@DecisiveIndecisive Morning!
DecisiveIndecisive
@DecisiveIndecisive
So I've been struggling with this issue for a while now, in fact I went and finished every other part of the project I could before coming back to this. I'm generating a new photo API call every time a certain button clicks, but the rest of my page loads before the photo
I've tried loading a second photo in the background and changing to that one, and I've tried delaying the info until it registers a statechange with the API call but It's not having it. I've been on stackoverflow and do not understand the solutions there for the life of me. Anyone have any experience with this?
linkin-park
@linkin-park
help!
help! @Masd925
Christopher Brown
@ChrisBrownie55
@DecisiveIndecisive Code?
DecisiveIndecisive
@DecisiveIndecisive
There's a lot going on, but essentially when you click the Refresh Button I'd like to fade in a new image instead of calling the API and immediately removing the current one showing the blue background until the new image loads
Tom
@moT01
@DecisiveIndecisive so i assume its the pause between the two background images
you want one to just fade in or something without that ugly solid color showing up
what lines in the code are you setting the images - how are you doing it?
DecisiveIndecisive
@DecisiveIndecisive
The API call is in the function newImage()
In the Javascript I've got it so when you click the refresh button in the top right corner, it calls newImage()
Tom
@moT01
the call to get the new image takes too long is one problem i think
so im trying to think of the process that it happening and how you can make it like you want
DecisiveIndecisive
@DecisiveIndecisive
Well yeah, I'm rendering HD images. The question is, can I stop the function of my code until the new image is loaded entirely, and then proceed.
Or can I load it in the background and then "apply" it when I click refresh button
Tom
@moT01
right
DecisiveIndecisive
@DecisiveIndecisive
I understand what I need to do on paper, but writing the functionality has me running in cirlces
Tom
@moT01
you can - somehow
but it would take some rewriting
that 1500 ms timeout
thats for just visual right?
meaning you didnt put that in to try and fix this picture thing
DecisiveIndecisive
@DecisiveIndecisive
No, that's so the correct answer has time to display green before the new Image is called
Tom
@moT01
hmm
you want to like start getting that image right when you click refresh
DecisiveIndecisive
@DecisiveIndecisive
I'm nitpicking, the general functionality of this project is complete, I just need to get the Teet button to work and move on or I'll spend forever on this project :P
Tom
@moT01
so instead of the timeout
do something like this
refresh.click -> 
  change the settings(color: green or whatever)
  getImage().then -> { change background }
so the right answer will turn green - and just stay green till the image is retrieved
and then the background will change - and you would probly want to change the newQuote in there as well or something
just throwing some thoughts out there
DecisiveIndecisive
@DecisiveIndecisive
the newImage changes the background immediately though

$(".screen").css("background-image", "url('" + randomImage + "')");

This like right here immediately removes old background and begins loading the new background, so even if I change around the timeOut I'll have the same problem wont I?

Tom
@moT01
well you would need to change that too
unless all you want to do is get the image to fade in - and dont care about that gap between the picture change
DecisiveIndecisive
@DecisiveIndecisive
I don't see how I'm to separate the functions of getting the image, and then changing the background
Unless .then is an operator o.0
Tom
@moT01
then just waits for the function to be done
so you could return the url