jquery为按钮绑定事件(快速执行函数)

来源:互联网 发布:linux配置java环境变量 编辑:程序博客网 时间:2024/06/16 15:52
var queryFormArr = ['tone','singger','code','box','ugc',null];$(function(){$("#topSearchImg").bind('click',function(){search();});//为查询图片添加事件$("#searchType").children().css("cursor","pointer");$("#searchType").children().each(function(index,sp){$(sp).click(function(j){return function(){//点击事件var spans = $("#searchType").children();spans.removeClass().addClass("color2");spans.eq(j).removeClass().addClass("STYLE2");//queryFrom$("#queryFrom").val(queryFormArr[index]);}}(index));});});


原创粉丝点击