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.

Placement of Chat Box

View previous topic View next topic Go down

Solved Placement of Chat Box

Post by Merenwe on 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:



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
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 on 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
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Placement of Chat Box

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

Thank you! It worked perfectly!

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 on April 3rd 2015, 6:36 pm

You're welcome Smile

Topic archived

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

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