【发布时间】:2013-05-17 13:04:07
【问题描述】:
我正在使用 prettyphoto 媒体 wordpress 插件(版本 3.1.4)。
它对我来说工作正常,但我的问题是,当我单击任何图像并在灯箱中打开时,url 中有一些额外的标签,例如:#prettyPhoto[landscaping]/0/ 这就是为什么 url 看起来像:www.myssite.com/#prettyPhoto[landscaping]/0/。
我们怎样才能删除这个额外的标签。 这是我的 jquery.prettyPhoto.js 文件中的代码:
function setHashtag(){
if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
location.hash = theRel + '/'+rel_index+'/';
};
function clearHashtag(){
if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto";
}
【问题讨论】:
-
如果有人使用 prettyphoto 媒体 wordpress 插件,那么在插件自定义选项卡设置部分,您可以取消选中允许 prettyPhoto 更新 url 以启用深度链接。 [默认值:true]。它会起作用。
标签: javascript jquery tags wordpress prettyphoto