I've setup my site to scroll past a mandatory header element by using a scrollTop to a certain div function. I specifically set it to scroll slow so that the user "knows the header is up there" but on subsequent pages, I'd rather it just start at that scrolled position.
I'm trying to use a simple if / else statement to grab the wordpress page (is_home) and set the animation to 1200, else set the animation to 0. I've even gone in and setup a custom field on the page of is_home and True. But it's still not working. Any ideas how to fix the if / else or suggestions for a better way to implement this?
if (is_home()) {
$(window).load(function () {
$('html, body').animate({
scrollTop: $("#grey").offset().top
}, 1200);
});
} else {
$(window).load(function () {
$('html, body').animate({
scrollTop: $("#grey").offset().top
}, 0);
})
}