Search code examples
jquerysvgprettyphoto

loading gif does not disappear when using svg instead of jpg/png


I just tried to add svg graphics (using img tag for cross-browser compatability for now, not gzipped or something) into my prettyphoto-Gallery. First thing I noticed: It works. Pictures are shown. Yay! A few Seconds later: D'uh, the loading gif does not disappear anymore. Meh.

...So, to make a long story short, this is my problem. Does anyone know how I get the loading-gif to disappear after actually loading the svg file? It works with png/jpg.

To make clearer what I mean just look here at my testing environment and scroll a little bit down to the sheets-section (one row, 3 sheets): http://nie-wieder.net/sites/phil/pride/

Would be great if you could help me with this issue.

Greetings, Dominik


Solution

  • May be your png/jpg is not transparent so when you put them over your loading spinner, it seem disapear. But now SVG is totally vector and its transparent... so you spinner still there. I suggest you write a script to remove your spinner (div background) when loading finish.

    jQuery('div.view.view-first img').bind('load', function(){
    
       jQuery(this).parent('div.view.view-first').css('background','');
    
    });
    

    some thing like this