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

avatar
Administrator
Administrator


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


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



Forum Administrator, Coolyou,
Due to the volume of PMs I receive, I do not provide support via PM.
We have community forums for most support requests. If it's truly confidential, please do PM me.

Useful links:
-> Before asking question,  please use a Search option.
-> If you want to check our staff members click here.
->  Forum rules, this is a MUST READ thread.
->  FAQ (Frenquently asked questions)

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