1

I've encountered a weird CSS quirk where the layout misbehaves on the first load of a web page, but it works after you refresh. This behavior is only observed in Chrome.

To reproduce:

  1. Open https://coinchat.org/j:offtopic

  2. See that the right sidebar is pushed underneath the page, even through there is enough spacing and it is set to float: right

  3. Refresh the page

  4. Observe that the right sidebar is no longer pushed underneath the page.

  5. Open a new tab, open https://coinchat.org/j:offtopic

  6. Go to 2

The following code fixes this:

$("#chatsidebar").hide();
setTimeout(function(){
$("#chatsidebar").show();
}, 1);

My question is, why?

4

0 回答 0