Good art is a taste, good design is an opinion.


Come as guest, stay as family.
Board Index

Come as guest, stay as family.


You are not connected. Please login or register

Foto

[Javascript] Custom sound for Notifications (Forumotion Toolbar)



View previous topic View next topic Go down Message [Page 1 of 1]

1
Offline

  Shadow

Shadow
Administrator
Administrator

[Javascript] Custom sound for Notifications (Forumotion Toolbar) Alerte10

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)



- 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]


- Preview
No preview available




© PunBB Design


[Javascript] Custom sound for Notifications (Forumotion Toolbar) Act_bottom If you have any questions related to this topic create a topic with the following title:
Custom sound for Notifications (Forumotion Toolbar)

Powered by PunBB
Currently 0 users have thanked Shadow for this post:

View previous topic View next topic Back to top Message [Page 1 of 1]


Topic URL's

URL
BBcode
HTML

Permissions in this forum:
You cannot reply to topics in this forum