私はprettyPhotoを使用しています。画像をクリックすると、読み込み中のGIFが表示され、画像はロードされていません。ブラウザコンソールでこのエラーが見つかりました。未定義のプロパティ 'match'を読み取ることができません - prettyPhoto
Uncaught TypeError: Cannot read property 'match' of undefined
at h (jquery.prettyPhoto.js:7)
at HTMLDivElement.<anonymous> (jquery.prettyPhoto.js:7)
at HTMLDivElement.r.complete (jquery-1.10.2.min.js:5)
at c (jquery-1.10.2.min.js:3)
at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:3)
at l (jquery-1.10.2.min.js:5)
at x.fx.tick (jquery-1.10.2.min.js:5)
どうすればこの問題を解決できますか?
UPDATE
私はこの問題を考え出しました。画像はアンカータグの内側にあります。私が使用している場合$("div.news-text-detail a").prettyPhoto();
イメージがロードされています。これにより、すべてのアンカータグに効果が適用されます。しかし、これをアンカータグ内のONLYイメージに適用する必要があります。
$(document).ready(function() {
$("div.news-text-detail img").prettyPhoto();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/prettyPhoto/3.1.6/js/jquery.prettyPhoto.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/prettyPhoto/3.1.6/css/prettyPhoto.min.css" rel="stylesheet"/>
<div class="news-text-detail span12">
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/mV7ezeo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;">
<img border="0" src="http://i.imgur.com/mV7ezeo.jpg" data-original-height="384" data-original-width="800" height="305" width="640">
</a>
</div>
</div>
</div>
私たちはあなたのコードを手助けする必要があります...これは一般的なjsエラーです。これで何もできません。スニペットを作成します。 –
[Include snippet](http://imgur.com/a/sjCS7) –
imageanchorとは何ですか?あなたのコードに意味があると言っていますが、私はなぜそれが見えません。スニペットにいくつかのCSSを追加できますか? –