1

使用http://darsa.in/sly/

为什么这段代码不能让 Sly 工作?对不起,这是我第一次。我查看了文档并遵循了它,但它不起作用。有什么遗漏吗?我是 darsain 在 Sly 的新人。请帮我使用 SLY

<html>
<head>
    <style>
        * {padding: 0; margin: 0;}
        .frame {
            height: 100px;
            border: 1px solid silver;
            width: 100%;
        }
        .slidee {
            float: left;
            width: 100%;
        }
        .scrollbar { width: 100%; height: 10px; }
        .scrollbar .handle {
            width: 100px; /* overriden if dynamicHandle: 1 */
            height: 100%;
            background: #222;
        }
    </style>
    <script src="jquery.js"></script>
    <script src="sly.min.js"></sript>
    <script>
    $(document).ready(function(){
        var sly = new Sly('.frame');
        sly.init();
    });
    </script>
</head>
<body>
    <div class="scrollbar">
      <div class="handle"></div>
    </div>
    <div class="frame" id="oneperframe">

        <div class="slidee">
            <h2>This is a heading</h2>
            <p>This is a paragraph</p>
        </div>

        <div class="slidee">
            <h2>This is a heading</h2>
            <p>This is a paragraph</p>
        </div>

        <div class="slidee">
            <h2>This is a heading</h2>
            <p>This is a paragraph</p>
        </div>

    </div>
</body>

4

1 回答 1

0

尝试使用

<script src="http://darsa.in/sly/examples/js/vendor/plugins.js"></script>

jquery.js 之后

或者你这里有一个错误

<script src="sly.min.js"></sript>

一定是

<script src="sly.min.js"></script>

:P

于 2015-11-21T17:35:52.933 回答