2013-04-29 38 views
1

我正在使用jQuery調整插件大小Plugin here,它的工作原理與圖像應該一樣。jQuery Resize Plugin適用於<a>

但我想將它應用到畫廊Galleriffic

的問題是,主圖像在<a>擠包,當我添加一個類的<a>標籤的大小調整不起作用。

有什麼建議嗎?

這裏是我的標記:

<li> 
<a class="thumb resize2" name="imagen1" href="images/400x400-1.jpg" title="imagen1"> 
<img class="resize1" src="images/400x400-1.jpg" alt="Title #0" /> 
</a> 
</li> 
<li> 
<a class="thumb resize2" name="drop" href="http://farm3.static.flickr.com/2404/2538171134_2f77bc00d9.jpg" title="Title #1"> 
<img class="resize1" src="http://farm3.static.flickr.com/2404/2538171134_2f77bc00d9_s.jpg" alt="Title #1" /> 
</a> 
<div class="caption"> 
Any html can be placed here ... 
</div> 
</li> 

這裏的腳本:

<script> 
$(function() { 
    $(".resize1").aeImageResize({ height: 70, width: 70 }); 
    $(".resize2").aeImageResize({ height: 10, width: 10 }); 
}); 
</script> 

容量調整腳本是完美的,但我需要它funcion上<a>

P.D.我一般是jQuery和腳本編寫者。

UPDATE: 下面是截圖它是如何在瀏覽器中顯示: Screen shot of the code

這是一小部分來自galleriffic.js文件

var newSlide = this.$imageContainer 
        .append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#'+this.data[nextIndex].hash+'" title="'+imageData.title+'">&nbsp;</a></span>') 
        .find('span.current').css('opacity', '0'); 

       newSlide.find('a') 
        .append(imageData.image) 
        .click(function(e) { 
         gallery.clickHandler(e, this); 
        }); 

它的廣告提前鏈接類。

問題是:如何在類容器中添加一個類到圖像中?我希望我已經正確表達了自己。

謝謝

+0

你可以發表你曾嘗試過嗎? – 2013-04-29 10:04:22

+0

任何人都可以幫助我嗎? – 2013-04-29 14:45:59

回答

0

選擇當前顯示的圖像可以這樣實現的(只有一個在幻燈片圖像在給定時間):

$("div#slideshow img") 

但爲了改變畫廊「主」圖像的大小,你需要設置寬度和高度也爲下列元素:

$("div#slideshow a.advance-link") 
// and also the parent element of $("div#slideshow") which I can't see in the screenshot you attached. 

加上「調整」功能的<一>畫廊構建的元素不會影響畫廊形象。