Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 DIV help needed.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

laser
Advanced Member

Australia
3859 Posts

Posted - 10 September 2005 :  11:20:57  Show Profile
I just can't find the syntax I want to use for a certain div. The content is dynamic, so I want the DIV to resize up to a maximum of 7 lines of text (or 110 pixels if that's easier), but the text could be less than 7 lines as well.

Basically what I need is the syntax for a DIV so that it can change in height up to a maximum of 110 pixels.

Any ideas ?

Nathan
Help Moderator

USA
7664 Posts

Posted - 10 September 2005 :  13:59:55  Show Profile  Visit Nathan's Homepage
That "can" be done using CSS, but I don't think any browser supports it.

I is the space you want it to expand into going to remain void when the div is collapsed? If so you can accomplish it with two divs.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 10 September 2005 :  15:02:47  Show Profile  Visit MarcelG's Homepage
I think this can be done with the max-height property (and a trick for IE).
Perhaps something like this ;
mindiv {
border:1px solid red;
max-height:110px;
overflow:hidden;
height:expression(
    this.scrollHeight > 110? "110px" : "auto" );
}

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 10 September 2005 :  16:50:17  Show Profile
quote:
I is the space you want it to expand into going to remain void when the div is collapsed? If so you can accomplish it with two divs.
No, the space should be used for other things - what I'm basically doing is trying to make a sig height limiter. Members can post anything they want, but it will only show the first 110 pixels but some members don't have a sig so I don't want to show 110 pixels of whitespace.

quote:
I think this can be done with the max-height property (and a trick for IE).
Perhaps something like this ;

OK, I'll try that
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 11 September 2005 :  06:40:38  Show Profile  Visit MarcelG's Homepage
quote:
Originally posted by laser
what I'm basically doing is trying to make a sig height limiter. Members can post anything they want, but it will only show the first 110 pixels but some members don't have a sig so I don't want to show 110 pixels of whitespace.

Brilliant!!! Why didn't I think of that sooner!!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 11 September 2005 :  06:59:57  Show Profile  Visit MarcelG's Homepage
Btw; I've tested it, and it doesn't seem to work when used in a DIV, but it does work when used as a 'span'.
FireFox doesn't seem to understand the max-height thing either, so only IE works.

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 11 September 2005 :  09:39:48  Show Profile
That's OK, 95% of my users use IE, but what was the syntax you used ? From some reason I have both a span and a div (old code from before), but it always takes 110 pixels regardless
Go to Top of Page

Sonic
New Member

Germany
82 Posts

Posted - 11 September 2005 :  16:08:38  Show Profile  Visit Sonic's Homepage
i have something for you
--> http://forum.snitz.com/forum/topic.asp?TOPIC_ID=58931

mod is finished and works fine

ich finds genial...
bei uns ist es ratzekuz dunkel und bei dene alle heller nachmittag
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 11 September 2005 :  16:49:28  Show Profile
ah, thanks Sonic, I just need a few translations, but I'll throw them through babelfish and see what I get
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 12 September 2005 :  05:25:17  Show Profile  Visit MarcelG's Homepage
quote:
Originally posted by laser

That's OK, 95% of my users use IE, but what was the syntax you used ? From some reason I have both a span and a div (old code from before), but it always takes 110 pixels regardless

I've switched to Sonic's code, and this works perfectly in both IE as in FireFox!!!
Great feature!!!!!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.46 seconds. Powered By: Snitz Forums 2000 Version 3.4.07