1

要素を .animate (2 つの条件が true の場合) または (そうでない場合) .fadeOut しようとしています。

if (window.location.hash == '' && window.scrollTop() == '0') {
     //do .animate

if (window.location.hash == '' && (window).scrollTop() == '0') {
     //do .animate

最初のものは機能しますが、ウィンドウ scrollTop の構文を適切な方法で記述できません。

-グレタ

PSここにコード全体があります。上部の scrollTop 部分を除いて、すべてが機能しています。

   if (window.location.hash == '' || $(window).scrollTop() == '0') {

        $('#preloader').delay(3000).animate({
                        width:'792px', left:'50%', top:'-.5cm', marginLeft:'-396px', opacity:'0.75'},600,'easeOutExpo').animate({        
                        height:'0px', top:'13cm', opacity:'0'}, 400, 'easeOutExpo', function(){ 
                $(this).remove();
        }); 
        $('#headerwrapper').addClass('delay55sec animated250 entryShot easeInExpo');
        $('#foot').animate({top:'-16cm'},0,'').delay(3700).animate({top:'0'},900,'easeOutBounce');
        $('.block-menu li a').animate({left:'-20cm'},0,'').delay(4000).animate({left:'0px'},1234,'easeInOutExpo');
        $('.bodoni').fadeTo(0, 0).delay(5000).fadeTo(1555, 1.0);  
        $('#content').hide(0).delay(5000).slideDown(999, 'easeInExpo');
        $('#nav').animate({left:'-1500px'},0,'').delay(6000).animate({'left': '0px'}, 1555, 'easeOutBounce');  

  } else {

        $.scrollTo($(window.location.hash+"_"), 4444, {axis:'y', easing:'easeInOutQuint'}); 
        $('#preloader').delay(600).fadeOut(3000, function(){ 
                $(this).remove();
        });            
  }
4

0 に答える 0