perfect-scrollbar default scrollbar remains and the “perfect-scrollbar” not functional

余生颓废 提交于 2019-12-01 23:18:13

Try jQuery Scrollbar in your iframe.

<!DOCTYPE html>
<html>
    <head>
        <title>jQuery Scrollbar Demo</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="http://gromo.github.io/jquery.scrollbar/jquery.scrollbar.css">

        <script src="//code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
        <script src="http://gromo.github.io/jquery.scrollbar/jquery.scrollbar.js"></script>

        <script>
            jQuery(function($){
                $('.page-wrapper').scrollbar();
            });
        </script>

        <style type="text/css">
            html, body, .page-wrapper {
                border: none;
                height: 100%;
                margin: 0;
                padding: 0;
                width: 100%;
            }

            .page-content {
                padding: 10px 20px;
            }
        </style>
    </head>
    <body>
        <div class="page-wrapper scrollbar-macosx">
            <div class="page-content">
                [CONTENT HERE]
            </div>
        </div>
    </body>
</html>

In example above I've used scrollbar-macosx class, but you can choose any from predefined styles or make your own custom scrollbar - it's fully CSS customizable.

#amfCont needs a height property for this plugin to work. Here's the example from the docs.

#container {
    position: relative;
    height: 100%; /* Or whatever you want (eg. 400px) */
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!