PDA

View Full Version : font size



Chadi
03-09-2006, 10:35 PM
Using this: http://www.dynamicdrive.com/dynamicindex2/mikescroll.htm

Problem: font size

By default:
myScroller1.setFont("Arial", 1);

I actually want it exactly 8px. 1 is too small, 2 is too big. How do I convert it to 8px? I tried 8px and got script error.

jscheuer1
03-10-2006, 05:46 AM
From the demo page:

Note that you can insert HTML tags in the item text to mix fonts. The defaults are "Arial,Helvetica" and 2 respectively.

This means that you could also use span or division tags, ex:


myScroller1.addItem("<span class='scroller'>Click here for <a href='http://dynamicdrive.com'>Dynamic Drive</a>, the net\'s #1 DHTML site!</span>");

If you were to do this for all myScroller1.addItem entries, the entire style, including font-size, could be controlled from a stylesheet:


<style type="text/css">
.scroller {
font-size:12px;
}
</style>