2012-05-08 11 views
0

ディスコグラフィーページでクリックするのではなく、「li img」が読み込まれたときにこのjcarouselでリンクを開くことができます。 私はjQueryを学ぶデザイナーです。私と一緒に楽に行ってください。それが私の最初の質問です。事前に:)jcarousel clickの代わりにloadでアイテムを開く

$(function() { 
    /** 
    * build the carousel for the Albums 
    */ 
    $('#mp_albums').jcarousel({ 
     scroll: 1, 
     wrap: 'both', 
    }).children('li').bind('click', function() { 
     //when clicking on an Album, display its info, and hide the current one 
     var $this = $(this); 
     $('#mp_content_wrapper').find('.mp_content:visible').hide(); 

     $('#mp_content_wrapper').find('.mp_content:nth-child(' + parseInt($this.index() + 1) + ')').fadeIn(1000); 

    }); 

}); 

感謝。

+0

あなたが探しているものはあまり明確ではありません。 "リンク"とは何ですか?あなたは「ディスコグラフィーのページをクリックするのではなく」とはどういう意味ですか?カルーセルのHTMLがどのように見えるのかを教えてください。もっと情報をお願いします! – lbstr

+0

ディスコグラフィーのあるページがあり、jCarouselは親指をクリックするとdivを読み込みます。しかし、あなたの親指がクリックされたときに読み込まれたときに、アルバムに対応するdivが表示されます。 [リンク](http://www.gangrenagasosa.com.br/4.0/15.playlists/index_fade.html) – aarede

答えて

0

this jCarousel pageを適切なコールバックを見つけるためのリファレンスとして使用しました。 itemVisibleInCallbackが必要なようです。これはあなたを始めるはずです。何か問題や質問がありましたら教えてください。答えを編集できます。

$(function() { 
    /** 
    * build the carousel for the Albums 
    */ 
    $('#mp_albums').jcarousel({ 
     scroll: 1, 
     wrap: 'both', 
     itemVisibleInCallback: { 
      onAfterAnimation: openInfo 
     } 
    }); 

    function openInfo(carousel, item, idx, state){ 
     //when clicking on an Album, display its info, and hide the current one 
     var $this = $(item); 
     $('#mp_content_wrapper').find('.mp_content:visible').hide(); 

     $('#mp_content_wrapper').find('.mp_content:nth-child(' + parseInt($this.index() + 1) + ')').fadeIn(1000); 
    } 
}); 
+0

完全に尋ねられ、解決されました。私は、あなたが私のように他の人を助けることができるいくつかの話題を見つけることを願っています。本当にありがとう!!! – aarede

関連する問題