Iframe with pdf black flickering(blinking)

一笑奈何 提交于 2019-12-12 11:19:05

问题


I have an iframe with pdf on my page and try to disable scrolling of main window while scrolling iframe. Here is the code for it:

$('iframe')
    .mouseover(function () {
        var html = $('html');
        html.data('previous-overflow', html.css('overflow'));
        html.css('overflow', 'hidden');
        html.css('margin-right', '17px');
    })
    .mouseout(function () {
        // un-lock scroll position
        var html = $('html');
        html.css('overflow', html.data('previous-overflow'));
        html.css('margin-right', '0px');
    });

But such css changes causing flickering of iframe content (using Chrome 13). How can i fix this blinking?


回答1:


If you want to work on all browsers and OS, the only way is to use custom scrollbars such as Tiny scrollbar or you can take a loot at this scrollbars list http://www.net-kit.com/jquery-custom-scrollbar-plugins/.



来源:https://stackoverflow.com/questions/7200425/iframe-with-pdf-black-flickeringblinking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!