javascript - Set timeout while loading image in Div Background -
i loading image background url div:-
<div style="background-image: url('image.jpg'),url('fallback.jpg');"></div>
as understand, fallback image shown if there error while calling image.jpg
. :-
- will handle timeout errors when calling image.jpg?
- if yes, timeout duration?
- how control timeout duration?
edit: understood comments above not fallback, loading 1 on another. need set timeout , show alternate image after original not loaded in timeout.
you won't able find out time taken image loaded after set timeout, since might take little longer think depending on size of image. have worry order in assigning css properties fallback image. like, setting "no-repeat" first one, , opposite second on. her, can refer https://css-tricks.com/stacking-order-of-multiple-backgrounds/
Comments
Post a Comment