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.

Placement of Chat Box

2 posters

Go down

Solved Placement of Chat Box

Post by Merenwe March 25th 2015, 8:24 am

Hello!  I recently changed to a different chat box on my forum and was wondering if there is any way I can get it placed above the "Who Is Online?" portion of the forum main page.

Here's a picture of it:

Placement of Chat Box Move_c10

Here is the code I have for it as of now:
Code:
$(function() {
  if (!_userdata.session_logged_in) return;
  var content = '<div id=\"smartchatbox_img827631573\" style=\"width: 900px; height: 350px; overflow: hidden; margin: auto; padding: 0; border: 1px solid #000000;  background: url(\'http://www.somagames.com/redwall/pitch/wp-content/uploads/Redwall_Door_Wide.png\') 50% 50%; \"><div id=\"smartchatbox827631573\" style=\"width: 900px; height: 350px; overflow: hidden; margin: auto; padding: 0; border:0; \"><iframe src=\"https://www.smartchatbox.com/shoutbox/sb.php?key=827631573\" scrolling=\"no\" frameborder=\"0\" width=\"900px\" height=\"350px\" style=\"border:0; margin:0; padding: 0;\"></iframe></div></div>;',
      d = document.createElement('DIV');
  d.innerHTML = content;
 
  document.getElementById('page-body').appendChild(d);
});

Your help is greatly appreciated!
Merenwe
Merenwe
New Member

Posts : 2
Reputation : 1
Language : English

http://einnjoro.forumotion.com/

Back to top Go down

Solved Re: Placement of Chat Box

Post by Ange Tuteur April 2nd 2015, 9:33 am

Hi @Merenwe,

Replace your javascript by the following code :
Code:
$(function() {
  var who = document.getElementById('i_whosonline');
  if (!_userdata.session_logged_in || !who) return;
  var content = '<div id=\"smartchatbox_img827631573\" style=\"width: 900px; height: 350px; overflow: hidden; margin: auto; padding: 0; border: 1px solid #000000;  background: url(\'http://www.somagames.com/redwall/pitch/wp-content/uploads/Redwall_Door_Wide.png\') 50% 50%; \"><div id=\"smartchatbox827631573\" style=\"width: 900px; height: 350px; overflow: hidden; margin: auto; padding: 0; border:0; \"><iframe src=\"https://www.smartchatbox.com/shoutbox/sb.php?key=827631573\" scrolling=\"no\" frameborder=\"0\" width=\"900px\" height=\"350px\" style=\"border:0; margin:0; padding: 0;\"></iframe></div></div>;',
      node = who.parentNode.parentNode.parentNode.parentNode,
      d = document.createElement('DIV');
  d.innerHTML = content;
 
  node.parentNode.insertBefore(d,node);
});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Placement of Chat Box

Post by Merenwe April 2nd 2015, 11:12 pm

Thank you!  It worked perfectly!
Merenwe
Merenwe
New Member

Posts : 2
Reputation : 1
Language : English

http://einnjoro.forumotion.com/

Back to top Go down

Solved Re: Placement of Chat Box

Post by Ange Tuteur April 3rd 2015, 6:36 pm

You're welcome Smile

Topic archived
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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