0

モードにすると、次のエラーがIE9発生しIE7ます。小さなカウントスクリプトの使用:

SCRIPT1028:予期される識別子、文字列、または数値

コード

$.fn.countTo.defaults = {
    from: 0,  // the number the element should start at
    to: 100,  // the number the element should end at
    speed: 1000,  // how long it should take to count between the target numbers
    refreshInterval: 100,  // how often the element should be updated
    decimals: 2,  // the number of decimal places to show
    onUpdate: null,  // callback method for every time the element is updated,
    onComplete: null,  // callback method for when the element finishes updating
};

185行目は最後の中括弧とセミコロンです

これを機能させるために必要ですIE7が、このエラーはスクリプトを壊しています。

4

3 に答える 3

8

の後ろのコンマを削除しますonComplete

于 2012-05-29T21:06:35.250 に答える
5
$.fn.countTo.defaults = {
   from: 0,  // the number the element should start at
   to: 100,  // the number the element should end at
   speed: 1000,  // how long it should take to count between the target numbers
   refreshInterval: 100,  // how often the element should be updated
   decimals: 2,  // the number of decimal places to show
   onUpdate: null,  // callback method for every time the element is updated,
   onComplete: null  // callback method for when the element finishes updating
};

後のコンマを削除しますonComplete: null

于 2012-05-29T21:06:50.503 に答える
2

問題は、デフォルトの最終値の最後のコンマにあります。IEにはこれに関する問題があります。このようにして、あなたは良いはずです:

$.fn.countTo.defaults = {
    from: 0,  // the number the element should start at
    to: 100,  // the number the element should end at
    speed: 1000,  // how long it should take to count between the target numbers
    refreshInterval: 100,  // how often the element should be updated
    decimals: 2,  // the number of decimal places to show
    onUpdate: null,  // callback method for every time the element is updated,
    onComplete: null  // callback method for when the element finishes updating
};
于 2012-05-29T21:07:41.050 に答える