有谁用过GalleryView控件,如何给图片添加链接地址
本帖最后由 tcmis 于 2013-10-23 11:50:28 编辑
小弟用GalleryView控件图片播放,想给大图添加个链接地址,不管怎么弄都没效果, 大侠指点一下,谢谢。
http://spaceforaname.com/galleryview/demo-details.html
------解决方案--------------------给img增加href属性
<ul id="myGallery">
<li><img src="http://www.spaceforaname.com/galleryview/img/photos/bp1.jpg" alt="Lone Tree Yellowstone"
href="1" />
<li><img src="http://www.spaceforaname.com/galleryview/img/photos/bp2.jpg" alt="Is He Still There?!"
href="2" />
<li><img src="http://www.spaceforaname.com/galleryview/img/photos/bp4.jpg" alt="Noni Nectar For Green Gecko"
href="3" />
var gvImage = function (img) {
this.src = {
panel: img.attr('src'),
frame: img.data('frame')
------解决方案-------------------- img.attr('src')
};
this.scale = {
panel: null,
frame: null
};
this.height = 0;
this.width = 0;
this.attrs = {
title: img.attr('title')
------解决方案-------------------- img.attr('alt'),
description: img.data('description')
};
this.href = img.attr('href');
this.dom_obj = null;
return this;
},
//...........
_img.remove().appendTo(parent).wrap('<a
href="'+gvImage.href+'" target="_blank"></a>');