【发布时间】:2012-10-07 20:02:35
【问题描述】:
我在我的页面上做了类似的事情: http://manos.malihu.gr/tuts/horizontal-animate-page-to-id-jquery.html
除了我正在努力制作上一个/下一个按钮之外,它非常完美。我尝试了几种方法,但似乎不起作用,有人知道吗?
【问题讨论】:
我在我的页面上做了类似的事情: http://manos.malihu.gr/tuts/horizontal-animate-page-to-id-jquery.html
除了我正在努力制作上一个/下一个按钮之外,它非常完美。我尝试了几种方法,但似乎不起作用,有人知道吗?
【问题讨论】:
在我看来,最好的方法是增加锚点及其相关的内容选择器(例如 id: content-1/nav-1、content-2/nav-2 等)。您所有的导航项目都将具有.nav 的一般类,并且您所有的内容持有者将具有.content 的一般类。这样,您可以执行类似...
$(" [next/previous button] ").click(function(){
if ( $(this).attr("id") == "next" ) {
[call function to ADD 1 to the current content/nav]
} else if ( $(this).attr("id") == "previous" ) {
[call function to SUBTRACT 1 from the current content/nav]
}
});
【讨论】: