Tumblr 主题下一个 +上一页可见性
在创建 tumblr 主题的分页部分,我想放置一个上一页和下一页按钮,当没有上一页和下一页可用时,该按钮会禁用。明显的可用选项仅在存在下一页和上一页的情况下解决问题。
{block:PreviousPage}
<a href="{PreviousPage}" title='View newer posts'>
<input type='button' value='' class='pager pager_prev'/>
</a>
{/block:PreviousPage}
...
如果我在第 1 页,则仅显示下一个按钮(因此仅显示最后一页上的上一个按钮)。如何将下一个+上一个按钮置于禁用状态?谢谢。
On the paging part of creating a tumblr theme, I wanted to put a previous and a next button that is somewhat disabled when there are no previous and next pages available. The obvious available options only solves the problem if there is a next and previous page.
{block:PreviousPage}
<a href="{PreviousPage}" title='View newer posts'>
<input type='button' value='' class='pager pager_prev'/>
</a>
{/block:PreviousPage}
...
If I'm on page 1, only the next button shows up (and ergo only the previous button on the last page). How will I be able to place the next+previous buttons in disabled states? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,我正在回答我自己的问题。经过一些决定后,我最终使用 jQuery 来检查按钮是否存在,如果不存在,则将其作为子项附加到某些
td
或div
中。嗯,这不是完美的方法,但我想这在一两个计数上是有意义的,所以我现在正在实施这个。如果我在第一页,从逻辑上讲,我会检查上一个按钮是否存在:
如果我在最后一页,情况也是如此。
And yes, I am answering my own question. After some decisions, I ended up using jQuery to check if the button exists and if not, append it as a child to some
td
ordiv
. Well, this is not the perfect way to do it but I guess this makes sense on a count or two so I'm implementing this as of the moment.If I'm on page 1, logically, I'll check if the previous button exists:
the same goes if I'm on the last page.