Html 有没有办法在标题栏中使用GIFs?
我真的想为我的网站一个移动的标志。有没有办法使用HTML将浏览器选项卡顶部的徽标设置为GIF?尝试使用GIF作为图标Html 有没有办法在标题栏中使用GIFs?,html,web,Html,Web,我真的想为我的网站一个移动的标志。有没有办法使用HTML将浏览器选项卡顶部的徽标设置为GIF?尝试使用GIF作为图标 <link rel="icon" href="favicon.gif" type="image/gif" /> 如果你想让它在大多数浏览器上运行,你需要“手动”切换图像 var favicon_images = [ 'http://website.com/img/tm
<link rel="icon" href="favicon.gif" type="image/gif" />
如果你想让它在大多数浏览器上运行,你需要“手动”切换图像
var favicon_images = [
'http://website.com/img/tmp-0.gif',
'http://website.com/img/tmp-1.gif',
'http://website.com/img/tmp-2.gif',
'http://website.com/img/tmp-3.gif',
'http://website.com/img/tmp-4.gif',
'http://website.com/img/tmp-5.gif',
'http://website.com/img/tmp-6.gif'
],
image_counter = 0; // To keep track of the current image
setInterval(function() {
// remove current favicon
if(document.querySelector("link[rel='icon']") !== null)
document.querySelector("link[rel='icon']").remove();
if(document.querySelector("link[rel='shortcut icon']") !== null)
document.querySelector("link[rel='shortcut icon']").remove();
// add new favicon image
document.querySelector("head").insertAdjacentHTML('beforeend', '');
// If last image then goto first image
// Else go to next image
if(image_counter == favicon_images.length -1)
image_counter = 0;
else
image_counter++;
}, 200);
您可以在此处看到这一点: