http://tympanus.net/codrops/2010/10/07/slider-gallery/の写真スライダーコードを使用して、画像の下のリンクが新しいウィンドウに読み込まれるように変更しようとしています。
例えば:
<div class="content">
<div><a href="#"><img src="http://imageurl" alt="largeimageurl" /></a></div>
<div class="caption"><a target="_blank" href="image.php?id=someid&svc=somesvc" rel="nofollow">More Info</a></div>
</div>
私はjavascriptファイルでさまざまなことを試しました。現在は次のようになっています。
$fp_content_wrapper.find('.content').bind('click',function(e){
var $current = $(this);
//track the current one
current = $current.index();
//center and show this image
//the second parameter set to true means we want to
//display the picture after the image is centered on the screen
centerImage($current,true,600);
e.preventDefault();
});
私がする必要があるのは、その最初の行を変更して、通常どおりに選択するようにしますが、リンクが含まれているキャプションdivには何も適用しないため、通常どおりに動作します。
SOについても同様の質問があることは知っていますが、提案された質問のほとんどを試しました。私はJSの経験がまったくないので、簡単に間違っている可能性があります。
助けに感謝します!