It is an image replacement technique that relies on JavaScript to replace text with a dynamic image. In some browsers, like Opera or Mozilla, it can dynamically resize the text, based on the user's settings. Otherwise, the PHP script for creating the text image tries its best to resize and wrap the text.
You're looking at it. All of the headlines found inside div#body are dynamically generated with our replaceText function. This code is strongly based on PPK's image replacement technique.
replaceBg() is also included, which converts the text to a background image via CSS (a class name of fir is applied to all elements using this method)Note: Using static images, rather than dynamically created images, is perfectly fine to use in any of these instances.
What script would be complete without requirements?
getElementById and getElementsByTagName).font-size to pixels if you want dynamic resizing of text to work as intended.Keep in mind that these files are subject to change at any time.
| Filename | Purpose | Last Modified |
|---|---|---|
| common.js | Initializes our replacements | Jan 09, 2006 11:19 EST |
| texttoimage.js | Library to make convert text to images | Feb 14, 2006 12:23 EST |
| class.maketext.php | Creates the dynamic images (optional) | Jan 18, 2010 17:15 EST |
| Browser Name | Version | Supported |
|---|---|---|
| Opera | 8.x | Yes |
| Opera | 7.x | Yes |
| Opera | 6.x | No |
| Mozilla | 1.x | Yes |
| Netscape | 7.x | Yes |
| Netscape | 6.x | Yes |
| Netscape | 4.x | No |
| Internet Explorer (Win) | 6.0 | Yes 1 |
| Internet Explorer (Win) | 5.0 | Yes 1 2 |
| Safari | 1.x | Yes 3 |
1 Internet Explorer does not calculate font-size to a pixel value, instead it sends the exact CSS specified values. This only matters if you are using dynamic images.
2 Internet Explorer 5.0 supports all of the javascript just fine. However, it does not properly support many of the CSS techniques used for hiding the text. Using replaceText is the preferred method for this version.
3 Safari is unable to determine certain CSS information necessary to pass to the dynamic image generating script.
toImage() with nested tags.toBackground() by preloading the images. Images off screen were failing to load until the user scrolled to see them.