开发者

Display custom html in jQuery plugin Galleria's photo caption

Galleria is a very nice gallery plugin, but the information displayed in the photo caption (if you click the i symbol) is generated by the plugin.

Display custom html in jQuery plugin Galleria's photo caption

I am trying to find a solid way (content separation from presentation, cross-browser, standard-compliant, if possible) to be able to insert my custom html code (i.e. links and styles) in this caption text.

The plugin supports html caption with the dataConfig option, but it strips <a href=""></a> off.

To overcome this stripping, I found this to work:

JS

var _tit = $(img).next('h3').html();
var _info = $(img).siblings('.info').html();
var _url = $(img).siblings('.info a').attr("href");
var _user = $(img).siblings('.info a').children().html();
var _desc = _info + "<a href="+_url+">"+ _user +"</a>";
re开发者_C百科turn { title: _tit, description: _desc };

HTML

<span class="info">Subida por <a href="http://www.manolito.com">Manolito</a></span>

When ideally, a simple description: $('.info').html() should suffice...


Its supported by galleria, have a look here: http://galleria.aino.se/docs/1.2/options/dataConfig/


The developers of Galleria have now fixed this with the new version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜