1

コードが直接 head に追加された場合は問題なく動作するスライドショーがありますが、Modernizr ロード機能では動作しません。

ブラウザに応じて、同じページに必要なコード ファイルをロードする必要があります。Modernizr cssanimations と !Modernizr cssanimations の両方を使用してみましたが、役に立ちませんでした。

注釈付きのコードは次のとおりです。助けてください - ゴードン。

css3 animations works in Safari
<!--link href="_css3/css3_SLIDEglobal.css" rel="stylesheet" type="text/css">
<script src="_css3/css3_QUERYdisclose.js"></script-->



jQuery works in old Firefox and Opera
<!--link href="_jQ/jQ_SLIDEglobal.css" rel="stylesheet" type="text/css">
<script src="_jQ/jQ_QUERYanimateDisclose.js"></script-->


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="modernizr-latest.js"></script>

Q&A で推奨されているように、modernizr をロードしない、つまり !Modernizr を使用しない:

<script>
        Modernizr.load({
        test :        !Modernizr.cssanimations,
        yep :        ['_jQ/jQ_SLIDEglobal.css', '_jQ/jQ_QUERYanimateDisclose.js' ],
        nope  :      ['_css3/_css3_SLIDEglobal.css', '_css3/css3_QUERYdisclose.js']
                       });
        </script>

Modernizr の読み込みは、他のサイトで見られるように行います。

<script>
        Modernizr.load({
        test :      Modernizr.cssanimations,
        yep  :      ['_css3/_css3_SLIDEglobal.css', '_css3/css3_QUERYdisclose.js'],
        nope :      ['_jQ/jQ_SLIDEglobal.css', '_jQ/jQ_QUERYanimateDisclose.js' ],
                       });
        </script>
4

1 に答える 1

0

Vagrant extra li lurking in code. Once fixed, Modernizr.load works as expected. Interestingly the pages worked even with the li when only one set of style sheets was loaded.

于 2013-03-22T10:19:16.727 に答える