• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Open/Hide Online/Smileys out of line in FF

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
2 posts • Page 1 of 1

Postby andrewbelcher » Sat May 27, 2006 2:33 am

Hey...

This is quite an anal problem (but when it comes to look I tend to be...)

FF doesn't like 100% as a height/width option for divs... Therefore (as you can see in the demo on this site), the bottom of the chat window and the smileys window (on a standard loadup, ie with the online and smilies showing) aren't aligned correctly. To be precise the smilies window is 2px too high.

I've done problemsolving on this, and I've worked out what the problem is... When FF tries to do height: 100%; for the chat window, it infact does 100% of the containing div, rather than 100% of the space available inside it's container. So the chat window is actually 2px too big, resulting in it sticking out at the bottom a little bit, thus why the smilies window is that 2px higher, as by contrast it has an absolute bottom of 0, which is absolute of the space inside rather than the outside of the containing div.

Now I've managed to sort this problem for the standard display by ammending the css template file. This I recommend you implement even if nothing else is taken from this as it is probably a better way to do it. Rather than setting the height to 100% of the container, the best way to do it is also set the absolute bottom of the chat window to 0, resulting in the top, left and bottom always being at maximum inside the container.

However, this still leaves one problem... When you close one of the who's online/smilies boxes, the alignment is again out (2px too high at the top for smilies, 2px too low at the bottom for who's online). The reason being, when they are resized (line 971 of templates/pfcclient.js.tpl.php - the "refresh_OnlineAndSmileys" function) the remaining of the who's online/smilies window is set to 100%...


I'm having a bit of trouble working out exactly how this command works... This is the function:
Code: Select all
  refresh_OnlineAndSmileys: function()
  {
    var onlinediv = $('<?php echo $prefix; ?>online');
    var smileysdiv = $('<?php echo $prefix; ?>smileys');
    var style = $H();
   
    if (this.showwhosonline)
    {
      style['height'] = '';
      Element.setStyle(smileysdiv, style);
    }
    else
    {
      style['height'] = '100%';
      Element.setStyle(smileysdiv, style);
    }
    if (this.showsmileys)
    {
      style['height'] = '';
      Element.setStyle(onlinediv, style);
    }
    else
    {
      style['height'] = '100%';
      Element.setStyle(onlinediv, style);
    }

    // for IE7 CSS refresh
    // if fixes the smiley and online boxes resize problem on IE6
    if (document.recalc) setTimeout('document.recalc(true);', 0);
  }

I can see how this would set it to either hidden of taking up the whole height, but how does this bring it back to the size set in the css for when both boxes are shown?

My first reaction when I saw 100% was to think 'lets change the 100% to instead set absolute values for the top/bottom'... However, as I'm guessing the 100% also sets it back to the css percentage for when both boxes were there, I don't think that one would work.

Sorry if the post didn't make much sense... I can try to clarify anything that was non-sensical. Any ideas on how to solve the problem? I know it's only 2px, but it bugs me!
Last edited by andrewbelcher on Sat May 27, 2006 2:34 am, edited 1 time in total.
andrewbelcher
Member
 
Posts: 32
Joined: Tue Feb 28, 2006 1:47 am
Top

Postby phpfreechat » Sat May 27, 2006 10:11 am

Your post is interesting. I'd like to improve the default CSS theme.
Could you also post what you modified to the default CSS to remove the 2px problem ?
Also could you post a public like to a modified chat ?


regards,
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
2 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 22 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub