我正在使用jQuery resize插件Plugin here,它可以在图像上运行。
但我正在尝试将其应用到图库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>
调整大小脚本是完美的,但我需要它来<a>
Pd积。我总是在jQuery和脚本编写方面做得很好。
更新:
以下是在浏览器中显示它的截图:
以下是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+'"> </a></span>')
.find('span.current').css('opacity', '0');
newSlide.find('a')
.append(imageData.image)
.click(function(e) {
gallery.clickHandler(e, this);
});
广告推进链接类。
问题是:如何在高级类容器中向图像添加类?我希望我已经正确表达了自己。
谢谢,
答案 0 :(得分: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.
向&lt;添加“调整大小”功能a&gt;图库构建的元素不会影响图库图像。