Is there a way to create a invisible div, fill it with html, then truncate the html so that only the part that fits is left? For instance, suppose I make a div that has a certain height and width and I paste some html into it (programmatically) and then I want to find exactly at what letter or symbol or tag the html ends at. I guess there would be a problem with unmatched tags if the end tag got lopped off, but lets suppose I add those later.
Thanks.
Going backwards?
Instead of fitting the text to the container, decide on a word count to include. Alternatively, set the container to {overflow: hidden;}
. The first is a programming solution, the latter a css solution.
Better yet, tell us what you want to accomplish instead of asking how to do what you've decided is the solution.
cheers,
gary
Thanks for the info
I'm trying to make a kind of scroller, but this scroller does not have scrollbars, it has a NEXT button and a PREV button that moves to the next (or previous) chunk of text in the window. It would display html text, and maybe images, though I'm not sure that would fit.
Anyway, the problem is that I would have to not overspill my scroller boundaries.
So I have a huge html document, and I want to show only little bit at a time, that's where the problem arises.
Without getting into specifics...
This would seem to be a javascript issue, which is generally beyond the purview of this forum. Try searching for "javascript slider".
On the whole, I'd recommend staying with scrolling. Everyone knows how to scroll, and it is a Good Thing® to use the technology that your visitors know. But, it's your site to do with as you think best.
cheers,
gary
Well if you would like to
Well if you would like to place buttons as a scroller to show new chunks of text you might want to take a look over here: Vectordiv.
Hope this contains your question.