我正在尝试自定义两列 Google 自定义搜索。我真的很喜欢填充 div(默认 div#cse)的 iframe 上的 ajax。但问题是它会推动其他内容破坏页面。所以我想在单击“搜索”按钮时隐藏 div#content 中的内容,并在单击“重置按钮”时再次显示。为此,我尝试将单击事件处理程序绑定到提交按钮,但没有成功。
$(document).ready(function(){
$("input.gsc-search-button[type=submit]").click(function(){
alert("worked");
//hide div#content
})
})
然后我尝试检查它是否绑定了事件。虽然它不是我想要的。google api 不提供任何此类回调。
<input id="click" type="button" value="bind event"/>
$(document).ready(function(){
$("#click").bind('click', function(){
$("input.gsc-search-button[type=submit]").bind('click', function(){
alert("worked");
//hide div#content
})
})
})
有什么办法可以做到这一点吗?
谢谢。