jQuery Coda-Slider 可以重写选项卡更改时页面的标题吗?

发布于 2024-08-29 23:40:23 字数 155 浏览 2 评论 0原文

我们正在使用 Coda-Slider 构建一个网站,想知道是否可以在更改选项卡时更改页面标题(无需刷新页面)?我还不太擅长 jQuery(更不用说直接的 javascript),所以我不确定这是否可能。我们使用 Coda-Slider 2.0 版并从 Google 加载最新的 jQuery 库。

We are building a site with Coda-Slider and are wondering if its possible to change the title of the page when changing tabs (without having to refresh the page)? I'm not that great at jQuery yet (let alone straight javascript), so I'm not sure if this is even possible. We're using version 2.0 of Coda-Slider and loading the latest jQuery libraries from Google.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愿与i 2024-09-05 23:40:23

如果有一些“变化”,您可以尝试设置 document.title 属性由 coda 滑块提供的回调。

如果它不提供回调,您只需手动将单击事件连接到每个选项卡,然后尝试从那里更改标题。从他们的演示来看,每个选项卡看起来都是一个

Panel 1

。类似的东西应该有效。

$(".title").click(function(){
    document.title = " Whatever title you want goes here";
});

You could try setting the document.title property if there's some "on change" callback provided by the coda slider.

If it doesn't provide a callback you'll just have to wire up a click event to each tab manually and try to change the title from there. From their demo it looks like each tab an <h2 class="title">Panel 1</h2>. Something along the lines this of should work.

$(".title").click(function(){
    document.title = " Whatever title you want goes here";
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文