Posts

Showing posts from February, 2026

CSS position fixed bug

Image
A 'div' with 'position: fixed' was not visible when I forgot to give a 'top' or 'left' and other content filled the screen.  The 'div' is visible and below the other content if this content only partly fills the screen. If I say 'position: absolute' then the 'div' is at the bottom of the other content even if this content fills the screen. 

URL encoding SVG

Image
 The 'encodeURI' function on my old browser does not give the right output for a data URL for a background image of an SVG. So I use the free online URL encoder at:     https://yoksel.github.io/url-encoder/ My browser's 'encodeURIComponent' function does not give the right output either. Chromes's 'encodeURIComponent' function does not give the right output either. I tried changing all double quotes in the SVG to single quotes, but this did not give the right output either

setTimeout continues in hidden Chrome tab

Image
 I used 'setTimeout' to run a 20 second animation again two minutes after it first starts. But if I change tabs in Chrome after a a few seconds and come back to the original tab after a few minutes, then the first and second animations run together. It seems the hidden tab freezes but 'setTimeout' still counts down the seconds.