有没有办法同步gif文件? [英] Is there a way of syncing gif files?

查看:230
本文介绍了有没有办法同步gif文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含7个gif文件的页面。

I have a page with 7 gif files on it.

有没有办法同步它们,所以它们同时开始播放?

Is there a way to sync them all, so they start playing at the same time?

我正在考虑预加载它们,但如果加载时间比另一个加载时间更长,它们仍可能无法启动同步。

I was thinking of preloading them, but still they may not start synced if one takes longer to load than another.

推荐答案

正如@Archer在上面指出的,一种方法是预先加载它们然后重置src。使用jquery你可以做类似的事情:

As @Archer pointed out above, one way to do it is to preload them then reset the src. Using jquery you could do something like:

$(window).load(function() {
    $('.preload').attr('src', function(i,a){
        $(this).attr('src','').removeClass('preload').attr('src',a);
    });
});

jsfiddle

这篇关于有没有办法同步gif文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆