开发者

Cufon in Facebox

开发者 https://www.devze.com 2023-03-26 22:03 出处:网络
Does anyone have pointers for displaying Cufon in Facbox? I have recently implemented Cufon fonts which work fine, but when it is displayed in a Cufon dialog they arent being displayed on top. I can

Does anyone have pointers for displaying Cufon in Facbox?

I have recently implemented Cufon fonts which work fine, but when it is displayed in a Cufon dialog they arent being displayed on top. I can see that it is substituted though. I know this may have something to do with z-index but wonder exactly on what element/tag? I have tried on nearly al开发者_如何学Pythonl the tags from #facebox to the h1 tag inside the Facebox dialog.

Any pointers?


I think it may be because the Facebook is loaded in the DOM after you call and apply Cufon.

The (inelegant) solution would be to put a Cufon call in the HTML you're adding to the Facebox.

jQuery.facebox(function() { 
    jQuery.get('your-url.html', function(data) {
        jQuery.facebox(data + "<script>Cufon.replace('.selector');</script>")
    });
});


Cufon should start after loading the Facebox for the content appears

$(document).bind('reveal.facebox', function() { Cufon.replace('h3'); })
0

精彩评论

暂无评论...
验证码 换一张
取 消