2011-09-26 10 views
2

こんにちは、StackOverfowの良い人、私はFancyBoxのナビゲーション矢印の可視性の助けが必要です。画像グループにと表示されているのは、です(ホバー上だけでなく)invisibleがFancyBoxウィンドウで開いている動画に表示されている必要があります。特定のリンクのFancyBoxナビゲーション

私がイメージを持っているコードは次のとおりです。

$("a[rel=images]").fancybox({ 
    'transitionIn' : 'none', 
    'transitionOut' : 'none', 
    'showNavArrows' : 'true', 
    'titlePosition' : 'over', 
    'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { 
          return '<span id="fancybox-title-over">Image <strong>' 
           + (currentIndex + 1) 
           + ' </strong>/ ' 
           + currentArray.length 
           + (title.length ? ' &nbsp; ' + title : '') 
           + '</span>'; 
         } 
}); 

と私は画像に矢印が常に見えるようにするCSSの2行を追加しました:

#fancybox-left-ico {left: 20px;} 
#fancybox-right-ico {right: 20px;} 

開放のためのコードFancyBoxウィンドウの動画は次のとおりです:

$(".video").click(function() { 
    $.fancybox({ 
     'padding'  : 0, 
     'autoScale'  : false, 
     'transitionIn' : 'none', 
     'transitionOut' : 'none', 
     'title'   : this.title, 
     'width'   : 700, 
     'height'  : 450, 
     'href'   : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 
     'type'   : 'swf', 
     'swf'   : { 
      'wmode'    : 'transparent', 
      'showNavArrows' : 'false', 
      'allowfullscreen' : 'true' 
     } 
    }); 
    //$('.fancy-ico').hide(); 
    return false; 
}); 

私がビデオリンクをクリックすると、fancyboxウィンドウにboが表示されますそれは私の2つの追加されたCSSの行がそこにあるので理解できます。

$('.fancy-ico').hide(); 

のようなコード行を追加すると、ビデオウィンドウにまだ矢印が表示されずに開きます。問題は、最後のjquery行で矢印を隠してしまったため、画像を再度クリックすると矢印が表示されなくなります。

私の質問はどうすればこの仕事をすることができますか?どこのコードを挿入すればいいですか:

$('.fancy-ico').show(); 

このようなことを行うにはいくつかスマートな方法がありますか?画像は負荷をfancyboxたびに、それは同様に矢印が表示されます、そのよう :

は、あなたがあなたのイメージコードにONSTARTの機能を使用することができます任意の助け

+0

もう1つ、あなたのビデオはswfオブジェクトです。もしそうであれば、「$( 'fancy-ico')hide();」という文字を表示しなくても、 - 具体的には、フラッシュは常に他の要素の上に表示されるので、矢印が「下」になることがあります。あなたは "$( '。fancy-ico')。hide(); $( '。fancy-ico')を削除することでこれをテストできます。 – nonouco

答えて

1

ありがとうございました。

$("a[rel=images]").fancybox({ 
       'transitionIn'  : 'none', 
       'transitionOut'  : 'none', 
       'showNavArrows'  : 'true', 
       'titlePosition'  : 'over', 
       'titleFormat'  : function(title, currentArray, currentIndex, currentOpts) { 
        return '<span id="fancybox-title-over">Image <strong>' + (currentIndex + 1) + ' </strong>/ ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>'; 
       } 
       // onStart: "Will be called right before attempting to load the content" 
       'onStart'   : function() {$('.fancy-ico').show();} 

      }); 
関連する問題