現在の位置番号によって、フクロウのカルーセルの特定の位置にジャンプできる可能性があることを知っています。お気に入り:
$('.jumpTo').click(function(){
carousel.trigger('owl.jumpTo', 3)
});
一致するIDにジャンプすることはできますか?サムネイルのあるサイトがあり、そのうちの 1 つをクリックするとモーダルが開き、フクロウのカルーセルが適切な位置/一致する位置にあるとします。何かのようなもの:
var myattr = $(this).attr('subcategory');
$('.jumpTo').click(function(){
carousel.trigger('owl.jumpTo', '[subcategory="' + myattr + '"]')
});
前もって感謝します!
編集:
ハッシュ URL ソリューションも素晴らしいですが、フクロウのカルーセルがファンシーボックスで開きます...
2番目の編集:
すみません、仕様が変わって難しくなりました。フクロウのスライダーは、fancybox モーダルの iframe で開きます。それにデータを伝達する方法はありますか?!
3番目の編集:
ウェブサイトのコード:
<div id="theid" class="joinlight breit-quarter" subcategory="test">
<div class="breit-quarter-inside">
<a id="content_1_phcontent_1_rptPictures_ctl00_lnkImage" class="quarterthumb fancybox fancybox.iframe " href="extern1.html"></a>
<p>Quartier Reiterstaffel: Dies ist ein Testtext</p>
<p> </p>
<p><a id="content_1_phcontent_1_rptPictures_ctl00_lnkDownloadJPG" class="jobTitle" href="http://placehold.it/400x300">Download JPG</a></p>
<p></p>
</div>
</div>
iframe からのコード:
<div id="wrap">
<div id="wrap_small">
<div id="sync2" class="owl-retro-carousel">
<div class="item"><img src="http://placehold.it/80x60" /></div>
<div class="item"><img src="http://placehold.it/80x60" /></div>
<div class="item"><img src="http://placehold.it/80x60" /></div>
</div>
</div>
<div id="wrap_big">
<div id="sync1" class="owl-retro-carousel">
<div class="item"><img src="http://placehold.it/500x500" /><p>Room shot at the Delta Bow Valley during the speaker presentations</p></div>
<div class="item"><img src="http://placehold.it/500x500" /><p>Derrick Rozdeba, Bayer CropScience, presenting to delegate teams on how to present their ideas</p></div>
<div class="item" subcategory="test"><img src="http://placehold.it/500x500" /><p>Team presentations on Friday</p></div>
</div>
</div>
</div>
したがって、webiste の href をクリックすると、フクロウのカルーセルが 3 番目の (一致する) 項目にジャンプするはずです。