1

我已经设置了 jQuery 实时搜索,它运行良好:

<script type="text/javascript">
    $(document).ready(function() {
        $("#peopleSearch").keyup(function() {
            if ($(this).val()) {
                var search = $(this).val().toLowerCase();
                $(".user").hide();
                $("[user*='"+search+"']").show();
            }
            else {
                $(".user").show();
            }
        });
    });
</script>

但是,我有分页器,我的搜索只在当前页面上有效。我怎样才能让它在所有页面上工作?

<div class="paginator">
    {include file="ComEurolab/Views/paginator.tpl"}
</div>
4

1 回答 1

1

在您的搜索结果容器中使用 ajax,以便您的 JS 变量保持其状态。

于 2013-02-06T08:39:53.520 回答