0

我想使用 Backstretch jQuery 插件在起始页上创建全屏背景图片。因此我使用了以下代码:

<div class="startslide">
<script>
$.backstretch('IMG_3628.jpg');
</script>
</div>




<footer class="footer">>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.3/jquery.backstretch.min.js"></script>

</footer>

我真的不知道我做错了什么,因为我按照演示中描述的方式做错了......

我非常感谢您的帮助:)

4

2 回答 2

0

You have to call jQuery plugin before calling those of Backtrech.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.3/jquery.backstretch.min.js"></script>

Then, you have forget the []. Try that :

$.backstretch(['IMG_3628.jpg']);

Please find this JSFIDDLE

于 2015-09-07T14:23:48.647 回答
0
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.3/jquery.backstretch.min.js"></script>




<div class="startslide">
    <script>
        $.backstretch(['IMG_3628.jpg']);
    </script>
</div>
于 2015-09-07T14:25:21.317 回答