Sponsors
May 17, 2012, 09:34:49 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to get rid of the ugly jumping  (Read 2685 times)
Baskvald
Newbie
*
Posts: 2


View Profile



« on: March 04, 2009, 06:34:29 PM »

This is a wonderful script. Exactly what I have been looking for. It's only drawback is the ugly jumping when the text is replaced by the image. This is especially noticable when you use a non-standard font, that the user doesn't have.
After much fiddling, with visibility and delays, I solved it like this:

text2png.onLoad = function(){
if(document.getElementById('sidrubrik'))
{
//The element "sidrubrik" is empty to begin with, so for starters I fill it with something.
document.getElementById('sidrubrik').innerHTML=document.title;

text2png.replace('sidrubrik',{
'shadow_color':'#999999',  // the shadow color defaults to black
'shadow_distance':10,   // the distance in the shadow (set to zero to remove the shadow
'shadow_blur':8,  // where the shadow start fading
'shadow_strength':12,   // the opacity of the shadow
'shadow_angle':330  // the angle of the shadow (no comma after the last option)
});
//To make the text invisible, set the color to same as background and the size to 0
document.getElementById('sidrubrik').style.color='#F5E9F0';
document.getElementById('sidrubrik').style.fontSize=0;
}
}
I have used it for the headlines on this site:
http://www.norradalskulturforening.se
« Last Edit: March 04, 2009, 06:48:44 PM by Baskvald » Logged

Your Ad Here
Help us provide faster and better service. Donate Today!

Make payments with PayPal
admin
text2PNG Administrator
Administrator
Newbie
*****
Posts: 24


View Profile WWW Email



« Reply #1 on: March 05, 2009, 01:12:25 PM »

Hi Baskvald,
Thank you for the contribution, it looks nice and an easy way to add titles.

Sam
Logged

Making better text one word a time!

Your Ad Here
Help us provide faster and better service. Donate Today!

Make payments with PayPal
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC