Last active
February 2, 2017 19:38
-
-
Save lorashfuko/13ce782bfcc65dc119b3 to your computer and use it in GitHub Desktop.
Мигающий фавикон из двух картинок
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link id="favicon" rel="icon" href="путь/до/картинки1.jpg" type="image/x-icon" data="путь/до/картинки2.jpg" /> | |
function faviconPulse (time){ | |
var favicon = jQuery("#favicon"), | |
href = favicon.attr('href'); | |
if (favicon.attr('data')) { | |
var inter = setInterval(function(){ | |
if (favicon.attr('href') == href) { | |
favicon.attr('href', favicon.attr('data')); | |
} else { | |
favicon.attr('href', href); | |
} | |
}, (time ? time : 500)); | |
} | |
}; | |
faviconPulse(1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment