我使用的是漂亮照片的3.1.4版本。(http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/)。我想从URL中删除"#prettyphotoiframe/number/“。我设置了deeplinking:false,但这无济于事。我知道这可能是这些函数的问题所在:
function getHashtag(){url=location.href;hashtag=(url.indexOf('#prettyPhoto')!==-1)?decodeURI(url.substring(url.indexOf('#prettyPhoto')+1,url.length)):false;return hashtag;};
function setHashtag(){if(typeof theRel=='undefined')return;location.hash=theRel+'/'+rel_index+'/';};
function clearHashtag(){if(location.href.indexOf('#prettyPhoto')!==-1)location.hash="prettyPhoto";}有什么想法吗?
发布于 2013-03-26 16:11:36
a)这对我很有效:
function clearHashtag(){
if(location.href.indexOf('#prettyPhoto')!==-1)
location.hash="";
}这段代码位于jquery.prettyPhoto.js的底部
b)还有另一种方式,比如在jquery.prettyPhoto.js的开头设置:deeplinking: false。
我的意思是:
(function($){$.prettyPhoto={version:'3.1.4'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({.. deeplinking: false; ...}希望我能帮上忙。
发布于 2013-08-16 00:06:04
这是我的代码,它对我很有效:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
social_tools:false,
deeplinking:false});
});
</script>发布于 2013-12-20 17:02:41
3.1.5版本将正常工作
(function($){$.prettyPhoto={version:'3.1.5'};
$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend(
{.. deeplinking: false; ...} https://stackoverflow.com/questions/13417132
复制相似问题