【发布时间】:2013-01-10 03:20:02
【问题描述】:
我正在使用 Chained Selects jQuery 插件,http://www.appelsiini.net/projects/chained
但我想在第二个选择元素中添加一个跳转菜单,即需要点击提交。如果我使用处理程序更改,则会在链式脚本上触发。
$(function(){
$("#spotCat").chained("#locationCat");
$("#spotCat").change(function(){
window.location.href = $(this).val();
});
});
我不确定解决问题的最佳方法?当您“单击”选择下拉箭头时触发单击事件?
【问题讨论】:
-
我想了一个讨厌的方法来做这件事,但感觉不太好。 $(function(){ $("#spotCat").chained("#locationCat"); $("#spotCat").change(function(){ this.blur() }); $("#spotCat" ).blur(function(){ window.location.href = $(this).val(); }); });谁有更好的主意?
-
我不明白你想要完成什么,你能解释一下吗..
标签: jquery jquery-plugins chained