jquery实现点击切换图标
$(".statistic_table_head_date").bind("mousedown", function () { $(".statistic_table_head_date img:nth-child(1)").attr("src", "img/date_active.png"); $(".statistic_table_head_date img:nth-child(2)").attr("src", "img/open_active.png"); }).bind("mouseup", function () { $(".statistic_table_head_date img:nth-child(2)").attr("src", "img/open.png"); })
采用bind方法,mousedown是鼠标点击下去的时候触发,mouseup是鼠标抬起的时候,