开发者

Fancybox with Scribd

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');


}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜