Most intelligent way to control content height
Posted: Fri Mar 14, 2008 6:08 am
Hi,
At first I want to apologise if this content is in wrong section, as this matter concerns php, html and javascript, so i'm not sure where to put this. But, let's get to point.
We've been designing web page that has nice picture background, but we've run into little problem. As I mentioned, we have background image which is 1600x1200 (filesize optimized) but it can't be made any bigger than that. The height of this picture is a problem when page holds a lot of text, for example in news pages. Now we're thinking of ways to split the content of page (with read more -links or so). The div that holds the text has fixed width of 322px. Defining the limit for page size is quite hard with characters, as different words make linebreaks to different positions in text. Also user might user bigger/smaller font with their browser and that also changes the space the content needs. Now i'm wondering if there's way to get height of div, using javascript for example? Then we could code javascript buttons with css display -options to show the content in parts. Or is there any other way to do this? I know PHP's capabilities to count characters, and one way to solve this would be use loops, character counter functions and functions to parse spaces between words in texts to add the <br /> tags, but I don't find this very neat way to do this.
Is there any shortcuts to do this?
Regards,
Kalle Laakso
At first I want to apologise if this content is in wrong section, as this matter concerns php, html and javascript, so i'm not sure where to put this. But, let's get to point.
We've been designing web page that has nice picture background, but we've run into little problem. As I mentioned, we have background image which is 1600x1200 (filesize optimized) but it can't be made any bigger than that. The height of this picture is a problem when page holds a lot of text, for example in news pages. Now we're thinking of ways to split the content of page (with read more -links or so). The div that holds the text has fixed width of 322px. Defining the limit for page size is quite hard with characters, as different words make linebreaks to different positions in text. Also user might user bigger/smaller font with their browser and that also changes the space the content needs. Now i'm wondering if there's way to get height of div, using javascript for example? Then we could code javascript buttons with css display -options to show the content in parts. Or is there any other way to do this? I know PHP's capabilities to count characters, and one way to solve this would be use loops, character counter functions and functions to parse spaces between words in texts to add the <br /> tags, but I don't find this very neat way to do this.
Is there any shortcuts to do this?
Regards,
Kalle Laakso