FancyBox Script をカスタム スライドショーと組み合わせて使用しようとしていますが、うまくいきません。
ここに私のページがあります: http://www.edital.co.il/?page_id=37 (リンクが機能しない場合は、待ってからもう一度リロードしてください)
ご覧のとおり (53 行目)、fancybox が機能していることをテストするためだけに、fancybox ポップアップをロード直後に作成しました。
問題は、スクリプト 'http://www.edital.co.il/wp-content/themes/ediTal/library/js/libs/zoom-showcase.js?ver=3.4.2' 内で始まります (スクリプトは行にロードされます145) ファイル内の 57 行目: $this.trigger('click');
function gotoURL(event) {
var $this = $(this); // the <li> that has the youtube href attribute.
// the <li> has class="fancybox-youtube", so it should work:
$this.trigger('click'); // should trigger the <li>, but its not! (the problem)
}
トリガーは、fancybox によって html ファイルの 67 行目に設定されます。
jQuery(document).ready(function($){
/* Fancybox code start... */
var fb_timeout = null;
var fb_opts = { 'overlayShow' : true, 'centerOnScroll' : true, 'showCloseButton' : true, 'showNavArrows' : true, 'onCleanup' : function() { if(fb_timeout) { window.clearTimeout(fb_timeout); fb_timeout = null; } } };
$('[href*="youtube.com/"]:not(.nofancybox)').addClass('fancybox-youtube');
$('[href*="youtu.be/"]:not(.nofancybox)').addClass('fancybox-youtube');
$('.fancybox-youtube').fancybox( $.extend({}, fb_opts, { 'type' : 'iframe', 'width' : 640, 'height' : 390, 'padding' : 0, 'autoScale' : false, 'titleShow' : false, 'titlePosition' : 'float', 'titleFromAlt' : true, 'onStart' : function(selectedArray, selectedIndex, selectedOpts) { selectedOpts.href = selectedArray[selectedIndex].href.replace(new RegExp('youtu.be', 'i'), 'www.youtube.com/embed').replace(new RegExp('watch\\?v=([a-z0-9\_\-]+)(&|\\?)?(.*)', 'i'), 'embed/$1?version=3&$3') } }) );
/* Fancybox code end... */
/* Thats working, but gotoURL() does not. */
$('a[class=fancybox-youtube]').filter(':first').trigger('click');
});
基本的に何が起こっているか: Fancybox は「fancybox-youtube」クラスを href=youtube のタグに追加しています...
私の推測では、どちらも異なる $ を持っているため、一緒に動作しません。それが問題の原因かどうかはわかりませんが。