javascript - Loading gif is not animating? -


on clients webpage, page uses js/css style tree-style view desired of client. on of pages many objects takes time styles load. suggested adding loading screen.

here example of issue: http://zamozuan.com/content/16-search-auto-parts-by-vehicle-chevrolet

my client purchased little animated icon fits theme of site nicely.

i have simple addition script add loading icon, , on $(document).ready, hiding load element , showing main element.

all works fine except loading gif not animating until after page has loaded.

it seems loop js intensive gif not animating.

before chops head off, did view similar questions on here, solutions not work me - majority of issues in ie , issue in chrome (not ie), , of other options work-arounds based on clicking buttons enable/disable, in case when page loads not viable.

i wondering, there work-around fix this? possible pre-load gif in animated status , somehow prevent js interfering? or there way make js loop not intensive freezes browser?

as code, exact link above, added @ end:

$('#loading').hide(); $('.mainsearch').first().css('display', 'block'); 

the loading element contains:

<img src="img/loading.gif" class="img-responsive"> <p class="centertext">loading, please wait...</p> 

but mentioned, gif not load, freezes.

for javascript styling tree, can view here:

http://zamozuan.com/js/tree.js

any appreciated, client not want waste loading icon bought.

thanks.

no, there no work-around. it's not problem how image loaded, won't animated while script running.

javascript single threaded. long script running, there no visual updates in browser. includes gif animations, while script running animations won't move.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -