使用 jQuery Address 更改后退按钮上的页面标题
利用 jQuery Address 启用浏览器的后退按钮,我能够利用插件的事件“onExternalChange”来检测浏览器何时实际点击后退按钮,以便我也可以触发页面标题更改。不幸的是,我无法让它抓住当前部分,因为它在跳跃之前抓住它,因此每次都是一次:
$.address.externalChange(function() {
var lastPageTitle = 'Kevin Dare Foundation | ' + $('nav').find('.active').html();
$.address.title(lastPageTitle);
});
Utilizing jQuery Address to enable the browser's back button, I was able to leverage the plugin's event "onExternalChange" to detect when the browser actually hits the back button, so that I could trigger the page title to change on that as well. Unfortunately I can't get it to grab the current section, as it grabs it before it jumps, thus being one off everytime:
$.address.externalChange(function() {
var lastPageTitle = 'Kevin Dare Foundation | ' + $('nav').find('.active').html();
$.address.title(lastPageTitle);
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来以下问题可以解决:
Looks like the following solves the problem: