How to get FlexPaper’s Instance and some methods can we called

image

class 为 flexpaper_viewer 的div 是 整个 插件的 内容容器。

那么获取 插件的Instance 的方法就是:

window.$FlexPaper() 函数就是获取当前的 文档实例。需要的参数 就是 内容容器 div 的id;

那么 window.$FlexPaper 函数的内容是:

window.$FlexPaper=function(id) {
                    var instance = (id === "undefined") ? "" : id;

                    if(window['ViewerMode'] == 'flash') {
                        return window["FlexPaperViewer_Instance" + instance].getApi();
                    } else if(window['ViewerMode'] == 'html') {
                        return window["FlexPaperViewer_Instance" + instance];
                    }
                }

 

使用 window.$FelxPaper() 获取到的 Instance 对象如下:

image

 

image

 

一些常用的方法有:

getCurrPage   //获取当前页码

getTotalPages   //获取总共的页数

gotoPage(number 页码)  //跳转页面

prevPage      //跳转到上一页

searchText(text)   //搜索文字

setZoom        //设置缩放比

posted @ 2013-04-02 00:17  高捍得  阅读(194)  评论(0编辑  收藏  举报