If I use the CSS "overflow" property and set it to hidden (the content is clipped, but the browser does not display a scroll-bar to see the rest of the content), the question then is I guess...
... how to then determine when serving the content up from within ones RoR application, know how much text/content to give to the view to display, such that just before the end of the content a "..more.." link can be provided ( i.e. to allow user to jump to a page dedicated to showing all the content for that record). Factors would have to include: browser resizing, text size resizing I guess. Any ideas on how to best do this? (again the goal is to show snippets of content for each item [user generated] on a shared front page, and for those that go over the available space allocated on the shared splash page, insert a "..more.." link to jump to a dedicated page for showing all the content for that particular record) Tks Greg Hauptmann wrote: > > Hi, > > > > Can anyone recommend how best to how to dynamically constrain amount of > > Text/Content in a DIV area that can vary in size?? > > > > That is, say you have: > > (a) a content (DIV) area on your view that can expand/contract depending > > upon browser size ( i.e. when someone is re-sizing the browser window) > and > > (b) dynamic text/content that is to be displayed, based upon user input > - > > e.g. image a defined area/size for several user comments for example. > Users > > can create their own comments, but you only want them to be able to take > up > > a given amount of screen resource, and then perhaps have a "...more" > link at > > the bottom if they go over. > > > > How can I best setup this up? e.g. > > (1) How to setup the layout/CSS so that if more text / content is > present in > > the DIV area that can be displayed that the DIV area doesn't expand due > to > > the extra content the user put forward, and/or > > (2) Do I need to also complete this by programming what content comes > out? > > E.g. in Ruby on Rails say then the question would be how to calculate > how > > much text/content can fit in the current size of the DIV (noting browser > > re-sizing) so that you get the chance to put the "...more" link at the > > bottom? Hopefully this approach isn't required. > > > > Any other suggestions welcome that address what I'm trying to do are > > welcome, which is really offering a area for display of user feedback > where > > each piece of feedback has a maximum area it can take on the main screen > > only, and also that browser re-sizing is possible. > > I'm not sure if you can add a "more" link dynamically with CSS. That's > usually the job of the CMS which I'm assuming you're using since you say > the content is dynamic. In any case you can put a height on the div > with overflow: hidden then when the "more" link is clicked the CSS > changes to overflow: visible or something similar. I saw something > similar on this site a while back. I'd be surprised if you can't find > it there: http://www.cssplay.co.uk/menu/index.html > > AC > > > > Tks > > Greg > > ______________________________________________________________________ > > css-discuss [EMAIL PROTECTED] > > http://www.css-discuss.org/mailman/listinfo/css-d > > IE7 information -- http://css-discuss.incutio.com/?page=IE7 > > List wiki/FAQ -- http://css-discuss.incutio.com/ > > Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ > > > -- > Audra Coldiron > > Rock-n-Roll Design & Hosting > http://rock-n-roll-design.com > > KarmaCMS ( http://karmawizard.com ) - the ultimate CSS styled CMS. > Pre-made designs, designer tools, and reseller program available! > ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
