我實現了巨大的[galleriffic] [0] - jQuery插件,並希望在每張照片上設置一個類似Facebook的按鈕。 現在,我想它在onSlideChange() - 函數是這樣的:jQuery-Galleriffic,在每張照片上設置facebook like-button
$(".fb-like").attr("data-href","http://ulc.local/galerie/25#"+nextIndex);
,但沒有成功。只要我點擊一個按鈕,其他圖片上的所有其他按鈕也會啓用。
任何幫助,非常感謝。
編輯:下面是一些更多的代碼:
<div id="gallery" class="content-image">
<div class="border-left"></div>
<div class="slideshow-container">
<div id="loading" class="loader"></div>
<div id="slideshow" class="slideshow">
<div id="slide-container">
<div id="slider">
<div id="title"></div>
<div id="share">
<div class="fb-like" data-send="false" data-layout="button_count" data-width="150" data-show-faces="true"></div>
<div id="spacer"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en" data-count="none"></a>
</div>
</div>
</div>
</div>
</div>
<div class="border-right"></div>
</div>
<div style="clear:both"></div>
與類的格「FB狀」應顯示的按鈕。 現在我試着用這一個在onSlidechange()來代替這個div:
onSlideChange:function(prevIndex, nextIndex) {
// 'this' refers to the gallery, which is an extension of $('#thumbs')
this.find('ul.thumbs').children()
.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
.eq(nextIndex).fadeTo('fast', 1.0);
newUrl = "http://ulc.local/galerie/25/";
$(".fb-like").replaceWith("<div class='fb-like' data-href='http://ulc.local/galerie/25#' "+nextIndex+" data-send='false' data-layout='button_count' data-width='150' data-show-faces='true'></div>");
}
我想做出幾個樣的按鈕,我馬上更改數據,href屬性作爲下一個圖像用戶點擊。不幸的是,沒有顯示按鈕。
所以你不知道這個傑克?我會非常感謝任何幫助。 – enne87 2012-04-08 22:21:54