User / Developer Forum
Is there a way to apply typeface dynamically via javascript?
Saff
|
23 Mar 2010 19:49
Yes, but need to call _typeface_js.initialize(); to redraw div's (even if they dynamicly loaded).
It works fine for Safari|IE|Opera(not shure need to test), but there is a bug in firefox with redrawing.
You need to wait for some time(i set 1 sec) before reinitial ))) I don't know why(maybe because i load content dynamicly), but it works ))) Little example:
var t = null;
$(document).ready(function(){
$('#low_top_12').load('/shop/show_top/',function(d){t=setTimeout("redraw()",1000);});
});
function redraw()
{
_typeface_js.initialize();
clearTimeout(t);
}
Regards, djsaff [@] gmail [dot] com
It works fine for Safari|IE|Opera(not shure need to test), but there is a bug in firefox with redrawing.
You need to wait for some time(i set 1 sec) before reinitial ))) I don't know why(maybe because i load content dynamicly), but it works ))) Little example:
var t = null;
$(document).ready(function(){
$('#low_top_12').load('/shop/show_top/',function(d){t=setTimeout("redraw()",1000);});
});
function redraw()
{
_typeface_js.initialize();
clearTimeout(t);
}
Regards, djsaff [@] gmail [dot] com
Brett
|
10 May 2010 17:56
Try this instead:
_typeface_js.renderDocument();
Does the same thing quicker; fewer redundant calls.
_typeface_js.renderDocument();
Does the same thing quicker; fewer redundant calls.
Post a Reply
m