последний вариант кода: может кому пригодиться.
$(function () {
var getCookie=function(e){var o=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return o?decodeURIComponent(o[1]):void 0};
var setCookie=function(e,o,r){r=r||{};var i=r.expires;if("number"==typeof i&&i){var t=new Date;t.setTime(t.getTime()+1e3*i),i=r.expires=t}i&&i.toUTCString&&(r.expires=i.toUTCString()),o=encodeURIComponent(o);var n=e+"="+o;for(var a in r){n+="; "+a;var v=r[a];v!==!0&&(n+="="+v)}document.cookie=n};
$(document).scrollTop(1);
var temp1 = getCookie("lapa-slider-first-set");
if(temp1 != 1) {
$("#bigslider").animate({height: "show"}, 500);
setCookie("lapa-slider-first-set", "1", {expires: 86400 * 90});
}
var firstScroll = 0;
$(document).scroll(function() {
var oy = $(document).scrollTop();
if(oy == 0) {
$(document).scrollTop(1);
return;
}
if(firstScroll == 2) {
if(oy > 1) {
firstScroll = 0;
$(document).scrollTop(1);
$("#bigslider").animate({height: "hide"}, 500);
}
return;
}
if(oy > 1) {
firstScroll = 0;
return;
}
if(firstScroll == 0) {
firstScroll = 1;
return;
}
firstScroll = 2;
$("#bigslider").animate({height: "show"}, 500);
});
});