我正在做一个内容加载器,加载的内容需要一些 Cufon 操作。这现在不起作用,因为我只在初始页面加载时应用 Cufon。而不是新加载的内容。
现在,这不应该工作吗?
function loadContent() {
$('#content').load(toLoad,'',showNewContent())
Cufon.replace('h1, h2, h3, h4, .menuwrapper', { fontFamily: 'advent'});}
还是我没有得到什么?我还尝试在调用 loadContent 函数的过程之后立即调用 Cufon.Replace,但这只会在我下次单击链接时应用 Cufon。
$('.dynload').live('click', function(){
var toLoad = $(this).attr('href')+' #content';
$('#content').fadeOut('fast',loadContent);
$('#ajaxloader').fadeIn('normal');
window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length);
Cufon.replace('h1, h2, h3, h4, .menuwrapper', { fontFamily: 'advent'});
如何确保在加载新内容后尽快应用 Cufon?我正在考虑在新内容淡入之前调用 Cufon.replace 。但这似乎不起作用。