0

「ADAPT_CONFIG が定義されていません」というエラーが表示されますが、ページに構成を含めました。

{% block javascripts %}
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="{{ asset('/bundles/dproc/assets/js/adapt.min.js') }}"></script>
    <script>
    // Edit to suit your needs.
    var ADAPT_CONFIG = {
     // Where is your CSS?
    path: 'assets/css/',

    // false = Only run once, when page first loads.
    // true = Change on window resize and page tilt.
    dynamic: true,

    // First range entry is the minimum.
    // Last range entry is the maximum.
    // Separate ranges by "to" keyword.
        range: [
        '0px    to 760px  = mobile.min.css',
        '760px  to 980px  = 720.min.css',
        '980px  to 1280px = 960.min.css',
        '1280px to 1600px = 1200.min.css',
        '1600px to 1940px = 1560.min.css',
    '1940px to 2540px = 1920.min.css',
    '2540px           = 2520.min.css'
     ]
    };
    </script>
    {% endblock %}

定義されています..しかし、何が問題なのかわかりませんか?

4

2 に答える 2

1

切る

  <script src="{{ asset('/bundles/dproc/assets/js/adapt.min.js') }}"></script>

以下に貼り付けます:

 <script>
// Edit to suit your needs.
var ADAPT_CONFIG = {
 // Where is your CSS?
path: 'assets/css/',

// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
    range: [
    '0px    to 760px  = mobile.min.css',
    '760px  to 980px  = 720.min.css',
    '980px  to 1280px = 960.min.css',
    '1280px to 1600px = 1200.min.css',
    '1600px to 1940px = 1560.min.css',
'1940px to 2540px = 1920.min.css',
'2540px           = 2520.min.css'
 ]
};
</script>

このような:

  <script>
// Edit to suit your needs.
var ADAPT_CONFIG = {
 // Where is your CSS?
path: 'assets/css/',

// false = Only run once, when page first loads.
// true = Change on window resize and page tilt.
dynamic: true,

// First range entry is the minimum.
// Last range entry is the maximum.
// Separate ranges by "to" keyword.
    range: [
    '0px    to 760px  = mobile.min.css',
    '760px  to 980px  = 720.min.css',
    '980px  to 1280px = 960.min.css',
    '1280px to 1600px = 1200.min.css',
    '1600px to 1940px = 1560.min.css',
'1940px to 2540px = 1920.min.css',
'2540px           = 2520.min.css'
 ]
};
</script>
<script src="{{ asset('/bundles/dproc/assets/js/adapt.min.js') }}"></script>

:)

于 2014-03-28T03:02:59.660 に答える
1

adapt_config 変数を宣言した後、adapt.js スクリプトを含める必要があります。

于 2014-01-05T11:52:59.677 に答える