我有一种情况,Fancybox 需要显示在页面顶部的视频下方。
$(function() {
    $('.index').click(function(){
    $('html, body').animate({ scrollTop: 500 }, 'slow'); 
    });
    $(".index").fancybox({
        'title'    : 'INDEX',       
        'width'    : 615,
        'height'   : 450,
                 ...
        'type'     : 'iframe'
    });
});
这很好用。页面下降 500 像素 - 在视频下方 - 并调用 FB。
但我需要的是只有当网页位于顶部时才会向下滚动。
所以,像:
    $(function() {
    $('.index').click(function(){
            if 500 pixels or more from the top {
    $('html, body').animate({ scrollTop: 500 }, 'slow');
            }); 
    });
    $(".index").fancybox({
            etc.
我该如何写那条条件行?