Sonja said:
> How do you do that? Is it something automatic (window setting
> perhaps?) or do you have to script it?
I wrote a little bit of JavaScript. If you put
<script type="text/javascript">
<!--
function setSize() {
if (document.body.clientWidth) {
columnWidth = document.body.clientWidth - 172;
}
else if (window.innerWidth) {
columnWidth = widow.innerWidth - 172;
}
newFontSize = columnWidth/40;
newFontSize = Math.max(8,Math.min(13,newFontSize));
document.body.style.fontSize = newFontSize+'pt';
}
//-->
</script>
in your header and change your body tag to read
<body onload="setSize()" onresize="setSize()">
then it should work. You might have to change the various numeric values
in the function to get results that look nice.
> And why resize the fontsizes?
I wanted to keep an approximately constant number of words per line
regardless of the size of the window.
> Do you detect the resolution settings of the person visiting your
> site to select the correct size settings? I mean if you've got a
> lower resolution you could end up with some pretty unreadable stuff
> if you make the window smaller.
I detect the size of the window and then select a reasonable font size
from that. The font only various between certain bounds so that it
should remain readable even for very small or large windows.
> I've seen resizing features where the font stays the same and only the
> text wrap shortens. Is this the same kind of thing?
Similar, I suppose.
> It looks really cool though.
Thanks. The problem is that the font resize happens after the document
loads. This means that if you have anchors far down in your document and
people link to them the browser will jump to the right place but then
resize the text so that the position in the document is wrong. I found
this annoying enough that I stopped using the script on the rest of
Sharp Blue.
> Sonja
> GCU: Can I borrow?
Yes, of course.
Rich
GCU GPL
_______________________________________________
http://www.mccmedia.com/mailman/listinfo/brin-l