Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm probably crazy, but I've been staring at the two images for five minutes and can't see anything in one that isn't in the other, unless it is obscured by the annoying "view related gallery"button.

EDIT: Ok, half the time I load the page, the page works and I see the rock, but the other half of the time, the image is shifted down, the top half of the display box is black, and the "rock" is off screen...



You're not crazy.

Psst. Discovery folks. You've got yourself a race condition. You're calculating a `margin-top` to center an image vertically irrespective of whether that image has loaded. You either need to explicitly set the width and height as attributes on the image (good for preventing reflow anyway) or hold off on calculating your dimensions until after the image has loaded. You could even just wait for window load (instead of DOMContentLoaded).

EDIT: Here's an untested, hacky fix. Not an ideal solution but concise and without having to change anything. https://gist.github.com/anonymous/c40e8baf679aad65cb2c


CSS has race conditions?


It's JS, check the gist. The race condition is with image loading. I don't think CSS has race conditions, but someone please prove me wrong here :)


I suppose implementation could have, but since the language is declarative, I think that could rightfully be considered a bug.


Oh all right, that makes more sense.


Not that I know of, but javascript does.


Imagine the horror.


You're not crazy, they've discovered a Schrödinger's rock. With a ridiculously high Planck's constant, and conscious observation working backward in time through an imager and interplanetary transmitter to collapse the wave function. So, pretty big news.

[Edited to add umlaut.]


Wouldn't Schrödinger's rock with a high Planck's constant be a stick?


Link to the image directly. I also had problems with the gallery.

http://static.ddmcdn.com/gif/blogs/dnews-files-2014-01-myste...


Same thing happened to me. I stared and then reloaded page. Something is wonky with their gallery.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: