Объединение двух js скриптов в один
/* #1 */Отличаются они только #header-1 и #header-2. Можно как то склеить все в один скрипт?
$(document).ready(function(){var a=$("#header-1").offset().top;$(window).scroll(function(){if($(window).scrollTop()>a){$("#header-1").css({position:"fixed",top:"-2px"})}else{$("#header-1").css({position:"static"})}})});
/* #2 */
$(document).ready(function(){var b=$("#header-2").offset().top;$(window).scroll(function(){if($(window).scrollTop()>b){$("#header-2").css({position:"fixed",top:"-2px"})}else{$("#header-2").css({position:"static"})}})});
Источник:dle-faq.pro, DLE