【发布时间】:2014-01-26 19:35:26
【问题描述】:
我正在尝试将展开图像的主题标签链接替换为其标题,而不是编号索引。
我已设法从网址中删除不需要的编号,但我不知道如何检索标题。
在编辑 prettyPhoto javascript 时,我将 SetHashtag 函数更改为:
function setHashtag(){
var title = pp_titles;
if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
location.hash = theRel + '/'+title+'/';
};
在变量中使用“pp_titles”似乎会从整个图库中提取所有标题并将它们添加到 url 的末尾。我只想为当前图像使用标题,但我不确定从哪里检索它。
您可以在此处的任何图片中看到一个示例:http://www.sghalliday.com/urban2.html
当用户退出图库时,我也会尝试并希望从 url 末尾删除主题标签,但目前这没什么大不了的。
【问题讨论】:
标签: javascript jquery title hashtag prettyphoto