user2350143
user2350143

Reputation: 31

My .gif animation doesnt show in google chrome? Any ideas why?

var loadUrl = "winners.php";
var ajax_load = '<div class="preloaders"><img src="img/preloader.gif" alt="Loadig..."></div>';

$(".page").click(function(){
    $(".main").html(ajax_load).load(loadUrl);
});

I want to display my .gif animation in a web page, but it doesn't work in Google Chrome. With Firefox there is no problem. The idea is on a click to load the content and if it takes time to show the preloader.

Upvotes: 2

Views: 929

Answers (1)

Ren&#233; H&#246;hle
Ren&#233; H&#246;hle

Reputation: 27305

I think the problem is that you output the preloading image with javascript. Then you see the image first when the site is loaded.

A better way is to output the image direktly on your site over HTML without javascript.

<div id="preloaders" style="display: block;"><img src="img/preloader.gif" alt="Loadig..."></div>

If javascript is loaded and all your content is ready hide the div.

$('#preloaders').hide();

Upvotes: 1

Related Questions