2016-07-29 55 views
0

我使用Wordpress插件,终极WP查询过滤器,显示我的帖子与AJAX可以通过不同的过滤器类别。终极WP查询过滤器 - 通过单选按钮与'下一个'和'先前'箭头切换

目前,我仅限于将搜索栏显示为单选按钮,复选框或下拉菜单。

我想实现的是能够拥有可以切换单选按钮的下一个和前一个箭头。

我已经知道了,所以它检查箭头上的输入字段,但帖子并没有改变?任何人都可以将我指向正确的方向吗?

http://bluemoontesting.co.uk/carltonsmith/

$(document).ready(function(){ 
    $('.prev').click(function(){ 
     $(this).parent().find('input:checked').parent().prev().children('input').prop("checked", true); 
    }); 

    $('.next').click(function(){ 
     $(this).parent().find('input:checked').parent().next().children('input').prop("checked", true); 
    }); 
}); 

回答

0

答案是:只需添加.change()结尾,因为这将触发单选按钮,前面定义的onchange事件。

$(this).parent().find('input:checked').parent().prev().children('input').prop("checked", true).change(); 
+0

嘿人,我已经添加了你说的,但它仍然不工作?有任何想法吗? – Shaun