Help
Discuss or request ArrowChat modifications
User avatar
GBarthelot
Customer
 
Posts: 19
Joined: 07 Sep 2011, 12:07

 

by GBarthelot 03 Nov 2011, 01:36

Hi,

yesterday I needed to make the chatroom window bigger but for some reasons you can't declare height in %, you must use px or em so here is a short code you can use to make window size dynamic.

In file /includes/js/arrowchat_core.js

insert at line 10
Code: Select all
    //MOD Resize Chatroom Window
    function resizeChat(){
    var H = 0.8 //Edit here for final size in %   
    var FenH = a("#arrowchat_chatrooms_popup").height();
    a("#arrowchat_chatroom_chat").css({ 'height' : Math.floor(FenH * H});
    a("#arrowchat_chatroom_room_list").css({ 'height' : Math.floor(FenH * H)});   
    }
    //End


insert at line 256

After
Code: Select all
a("#arrowchat_chatrooms_button").click(function () {

code
Code: Select all
resizeChat();


So the window size is edit automatically when you click on the chatroom button.

If you want it to be resized dynamically on browser window resize you can had this code with jquery on your page

Code: Select all
<script type="text/javascript">
jQuery.noConflict();

//<![CDATA[
    jQuery(document).ready(function($) {
   function resizeChat(){
    var FenH = $("#arrowchat_chatrooms_popup").height();
    $("#arrowchat_chatroom_chat").css({ 'height' : Math.floor(FenH * .8)});
    $("#arrowchat_chatroom_room_list").css({ 'height' : Math.floor(FenH * .8)}); 
  }
  $(window).resize(function () {
   resizeChat();
   })
 });


Hope this will be useful for some of you
User avatar
Staff Bot
ArrowChat Team
 
Posts: 8996
Joined: 07 Nov 2012, 13:41

 

by Staff Bot 07 Nov 2012, 12:40

This thread has been locked because the last post is greater than six months old. There is a good chance that the information in this thread is outdated. Please open a new topic if you wish to discuss this further.