2015-06-12, 09:14
Tutorial: Custom sound for Notifications (Forumotion Toolbar) |
When you receive a new notifications in your toolbar, you will get a sound which will notify you about a news.
Created by @Ange_Tuteur
--> Tutorials, tips and tricks <--
Custom sound for Notifications (Forumotion Toolbar)
Custom sound for Notifications (Forumotion Toolbar)
1º - Javascript
Placement: In all pages
- Code:
[panda=js]var audioFile = 'http://www.freesfx.co.uk/rx2/mp3s/2/1305_1256857800.mp3';
notifChecker = setInterval('checkNotif()',500);
function checkNotif() {
if ($('.fa_notification').length > 0) {
window.clearInterval(notifChecker);
alertNotif();
}
};
dispCheck = setInterval('removeNotif()',500);
function removeNotif() {
if ($('.fa_notification').css('display') == 'none') {
$('.fa_notification').remove();
$('.audioElem').remove();
notifChecker = setInterval('checkNotif()',500);
}
};
function alertNotif() { $('body').append('<audio class="audioElem" style="display:none;" controls autoplay><source src="'+audioFile+'" type="audio/mpeg"></audio>'); };
In order to change a sound, edit the link from the following line
[ic]var audioFile = 'http://www.freesfx.co.uk/rx2/mp3s/2/1305_1256857800.mp3';[/ic]
2º - Preview
No preview available
© PunBB Design
If you have any questions related to this topic create a topic with the following title: Custom sound for Notifications (Forumotion Toolbar) |