PHP + Javascript Image Replacement
Some of you would have already used this but we thought to review this for those who haven’t put their hands on it.
This method is basically to get smooth font over your headings/titles. The package comes with a PHP and a Javascript file which replaces all the specified tags with images (dynamic). This can be applied to IDs/Classes/Tags on your site.
A few options over this:
- Line Breaks (enable/disable)
- Custom Fonts
- Font Size / Color
- Transparency
- Image flickering (enable/disable)
- more…
Customization
ifr.js
replaceSelector(” h2 “,” ifr.php “,false);
var testURL = “ test.png ” ;
- h2 - Tag to be replaced with the image
- ifr.php - the URL of the PHP file which generates the images.
- false - Enable/Disable line breaks (splits each word into an image so it floats below and goes on)
- test.png - the test image which loads to check if images are enabled on the browser (if not… the php will not generate the images)
.
ifr.php
$font_file = ‘futura.ttf’ ;
$font_size = 30 ;
$font_color = ‘#000000′ ;
$background_color = ‘#ffffff’ ;
$transparent_background = true ;
$cache_images = true ;
$cache_folder = ‘cache’ ;
The above is very much self explanatory…
.
Here is a working demo for download:
This file has been downloaded 4142 times.
All the files from the download has to be placed in the PHP server (localhost of your system). After you make the above changes you will look at index.php from your localhost for your new image replaced titles…
The final output:
This is a smooth font title generated over this method.
Another popular method would be sIFR where the titles are replaced with an SWF object.










