/**
*筛选框置顶显示
* @param {string} idname -需要置顶的元素id
*/
function searchFloat(idname){
var top = $(idname).position().top;
$(window).scroll(function(){
if($(document).scrollTop()> top){
//这里是判断页面宽度过小就不再置顶
if($(window).width()> 900){
$(idname).css({
"position":"fixed",
"top":0,
"z-index":999
});
}else {
$(idname).css({
"position":""
});
}
}else{
$(idname).css({
"position":""
});
}
})
}
$(searchFloat("#headtype"));