The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

is there a code to add auto notifications such HTML code

View previous topic View next topic Go down

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

Post by Michael_vx on April 12th 2014, 7: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
Forumember

Male Posts : 659
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 on April 13th 2014, 5: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 :

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://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 on April 13th 2014, 2: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
Forumember

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

Back to top Go down

View previous topic View next topic Back to top


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