Re: How can I find out when a background image is loaded?

2015-11-07 Thread Robert O'Callahan
On Sat, Nov 7, 2015 at 9:05 PM, Geoff Lankow  wrote:

> It's a lot harder to do what "background-size: cover" does, with an .


How about object-fit:cover?
https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit

Rob
-- 
lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
toD
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
rdsme,aoreseoouoto
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
lurpr
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
esn
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: How can I find out when a background image is loaded?

2015-11-07 Thread Geoff Lankow

It's a lot harder to do what "background-size: cover" does, with an .

GL

On 07/11/15 14:34, Robert O'Callahan wrote:

On Sat, Nov 7, 2015 at 2:17 PM, Geoff Lankow  wrote:


I'm displaying some quite large (6+ megapixels) images using CSS
background-image, and sometimes want to swap one for another. If I just
change the CSS property, there is a noticeable flicker as the first image
is removed, then the second image is loaded and displayed. I want to avoid
this.

My current approach is to create a second element behind the first, load
the new image in it, wait for a while, then remove the first element. This
works okay but it's a total guess how long "a while" should be - 500ms
seems to be a good amount on my machine with these particular images. So
how can I detect (with privileged code if necessary) when the second image
is ready to be displayed?


Use  elements instead?

Rob


___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


How can I find out when a background image is loaded?

2015-11-06 Thread Geoff Lankow

Hi all

I'm displaying some quite large (6+ megapixels) images using CSS 
background-image, and sometimes want to swap one for another. If I just 
change the CSS property, there is a noticeable flicker as the first 
image is removed, then the second image is loaded and displayed. I want 
to avoid this.


My current approach is to create a second element behind the first, load 
the new image in it, wait for a while, then remove the first element. 
This works okay but it's a total guess how long "a while" should be - 
500ms seems to be a good amount on my machine with these particular 
images. So how can I detect (with privileged code if necessary) when the 
second image is ready to be displayed?


GL

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: How can I find out when a background image is loaded?

2015-11-06 Thread Sam Giles
This might be relevant: https://bugzilla.mozilla.org/show_bug.cgi?id=1222670
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform