Tumblr 主题下一个 +上一页可见性

发布于 2024-12-13 21:04:45 字数 388 浏览 4 评论 0原文

在创建 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 技术交流群。

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

发布评论

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

评论(1

雨落□心尘 2024-12-20 21:04:45

是的,我正在回答我自己的问题。经过一些决定后,我最终使用 jQuery 来检查按钮是否存在,如果不存在,则将其作为子项附加到某些 tddiv 中。嗯,这不是完美的方法,但我想这在一两个计数上是有意义的,所以我现在正在实施这个。

如果我在第一页,从逻辑上讲,我会检查上一个按钮是否存在:

if($("input.previous_button").size()==0){
$("div.previous_button_box").html("<input type='button' class='pager pager-prev' ...
...

如果我在最后一页,情况也是如此。

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 or div. 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:

if($("input.previous_button").size()==0){
$("div.previous_button_box").html("<input type='button' class='pager pager-prev' ...
...

the same goes if I'm on the last page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文