The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

is there a code to add auto notifications such HTML code

2 posters

Go down

In progress is there a code to add auto notifications such HTML code

Post by Michael_vx April 12th 2014, 11:43 pm

is there a code to add auto notifications such HTML code like what in the forum tool bar but with out the tool bar thank you
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

In progress Re: is there a code to add auto notifications such HTML code

Post by Ange Tuteur April 13th 2014, 9:59 am

Hello Michael_vx,

You could probably make your own notifications system, but it would take a lot of work. This is just a quick example I wrote up :
Code:
$(function() {
    var body = document.getElementsByTagName('body')[0];
    var logout = document.getElementById('logout');
    
    var popup = document.createElement('DIV');
    popup.id = 'user_notif';
    popup.setAttribute('style','font-size:12px;color:#333;padding:3px;background:#EEE;border:1px solid #CCC;position:fixed;top:40px;right:100px;');
    
    var dismiss = document.createElement('DIV');
    dismiss.id = 'dismiss_notif';
    dismiss.innerHTML = 'Dismiss Notification';
    dismiss.setAttribute('style','cursor:pointer;text-decoration:underline;float:right;');
    
    dismiss.onclick = function() { popup.parentNode.removeChild(popup) };
    
    if (logout) {
        logout.onclick = function() {
            if (document.getElementById('user_notif')) return false;
            body.appendChild(popup);
            popup.innerHTML = 'You clicked the logout button !<br>';
            popup.appendChild(dismiss);
            return false;
        };
    }
});

Clicking the logout button will display a small notification saying that you clicked the logout button. You wont progress to the logout page, or logout. You can dismiss the notification by clicking the dismiss texts. If you wanted you could time the duration that the notification is displayed too.

Example :
is there a code to add auto notifications such HTML code Captu465
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13246
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

In progress Re: is there a code to add auto notifications such HTML code

Post by Michael_vx April 13th 2014, 6:06 pm

i didnt understand much
 Crying or Very sad 
all what in mind is something like text show you have new PM or watched topic and i need to use Arabic in side the code
for Example 
new PM
Code:
لديك رسائل خاصه جديد
new reply in wathced topic
Code:
هناك مشاركات جديده فى موضوع تراقبه
i tried by the way to add arabic messages in the word counter but its fail
im sorry for asking this much but im not that good in javascripts
right now im trying to understand the HTML codes and CSS
i still bad in javaScripts
 Sad 
my apologize
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Back to top


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