At 01:09 PM 11/03/2003 +0000, Niall O Broin wrote:
>I presume this works - however, it doesn't do anything different to what I
>already do from the server as I know the size of the image when I build the
Apologies. Was just posting a version that should work in more than NN4 -
as did Adam. Mine was DOM compliant AFAIK, his wasn't but certainly worked
on a lot of browsers.
>page. What causes me problems is the text which appears under the image.
>Depending on the phase of the moon and numerous factors, this text is going
>to occupy differing amounts of space and this is what causes the window size
>to need to be different. I can just make the window considerably longer than
>it need be, but then I usually end up with a lot of white space below the
>text which looks very poor. The code I posted
Ah yes. I remember you brought this up a few months ago :)
It is hackable but very ugly. Something along the lines of the following
(this is not working code):
<div id="myDescription">and in here goes our <b>description</b></div>
totalChars = document.getElementById("myDescription").innerText.length;
totalWidth = totalChars * averageCharWidth;
if (totalWidth > myWidth) {
// account for line wrap here, ie. increment your line height by some
set average line height
}
and so on. Course this would only work on more modern browsers - if using
NN4 you're out on your own. It could possibly be hackable in a similar way,
but I'm going nowhere near it :) What sort of percentage of visitors to
this site use NN4 ?
Lee Hosty -x- hostyle AT csn.ul.ie -x- +353 (0)86 8768780
--
YONKERS (n.)
(Rare.) The combined thrill of pain and shame when being caught in public
plucking your nostril-hairs and stuffing them into your side-pocket.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!