0
我有循环生成anchorlinks,在幻灯片页面内工作正常。但是,从其他页面链接到它们并不完美。他们总是转到组的第一张幻灯片,而不是由网址哈希定义的幻灯片。这里是我的代码:jQuery循环固定链接不工作,总是去第一张幻灯片
$(function() {
$('#cms').cycle({
fx: 'fade',
speed: 'fast',
pager: '#nav',
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#' + slide.title + '">' + slide.title + '</a></li>';
},
timeout: 0,
after: function(curr,next,opts) {
window.location.hash = $(this).attr('title');
}
});
});
及相关HTML:
<div id="nav"></div>
<div id="cms">
<div title="About"><?php include 'about.php' ?></div>
<div title="Music"><?php include 'music.php' ?></div>
<div title="Shows"><?php include 'shows.php' ?></div>
</div>
基本上,如果我链接到(或者打开一个新的浏览器选项卡并输入)的“http://路径/要/我的/ page /#音乐“或#Shows,它只是去#About。
我知道我失去了一些东西,但我不知道什么