2017-04-10 2 views
0

jQueryからmousewheelプラグインをインストールしたいので、マウスホイールの動きを使って機能を起動できます。これは単なるエラーインストールからGithubのファイルを停止して何jQueryのmousewheelプラグインがインストールされない

Refused to execute script from 'https://github.com/jquery/jquery- 
mousewheel.git' because its MIME type ('text/html') is not executable, 
and strict MIME type checking is enabled. 

を返し

<script src="https://github.com/jquery/jquery-mousewheel.git"></script> 

<script> 

$(window).mousewheel(function(turn, delta) { 

    if (delta == 1) // going down 
    else //going up 

    // all kinds of code 

    return false; 
}); 

</script> 

:私は、次のコードを持っていますか?その結果、私は次のエラーを取得:これはばかげた質問である場合には、事前に

Uncaught TypeError: $(...).mousewheel is not a function 

謝罪を、私はコーディングに非常に新しいだと私はなぜこれが起こっているの手掛かりを持っていません。

答えて

0

あなたがここにあなたのgithubのリンクファイルをダウンロードしたhttps://github.com/jquery/jquery-mousewheel?files=1

ダウンロードjquery.mousewheel.jsと参照があります.git

の代わりにファイルをgithubの参照からJavaScriptをダウンロードする必要があります。

+1

ありがとうございました!私はファイルをダウンロードし、私のウェブサイトのディレクトリに置いてそこでそれを参照しました。それは素晴らしい作品です!できるだけ早く答えを受け入れます。 –

関連する問題