Is there a way to use Scribd with Fancybox to ope开发者_开发百科n an iframe instead of opening up a separate window?
yes there is : attach your fancybox to a trigger, load fancybox and onComplete
initialize Scribd
$('element').click(function () {
$.fancybox({
href: 'remote/page/here',
onComplete: init_viewer
});
function init_viewer() {
doc_path = www.domain.com/yourdocument.pdf
//alert(finalurl);
var scribd_doc = scribd.Document.getDocFromUrl(doc_path, 'pub-YOURAPIKEY');
var oniPaperReady = function (e) {
// scribd_doc.api.setPage(3);
}
scribd_doc.addParam('jsapi_version', 1);
scribd_doc.addParam('height', 600);
scribd_doc.addParam('width', 800);
scribd_doc.addParam('public', false);
scribd_doc.addParam('disable_related_docs', true);
scribd_doc.addEventListener('iPaperReady', oniPaperReady);
scribd_doc.write('embedded_flash');
}
精彩评论