2017-03-16 5 views
-3

おそらく私は間違ったことを知っています!しかし何?アニメーションjQueryはCSS属性で正しく書かれません

$(".page-splash-page").bind("mousewheel DOMMouseScroll", function(){ 
    $(this).animate({ 
     -webkit-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     -moz-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
      }, 1000, function() { 
       { window.location.href = "http:..../work/"; } 
      }); 
    }); 
$(".page-splash-page").on("click touchstart", function() { 
    $(this).animate({ 
     -webkit-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     -moz-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
      }, 1000, function() { 
       { window.location.href = "http:...../work/"; } 
      }); 
    }); 
$(".page-splash-page").on("touchmove", function() { 
    $(this).animate({ 
     -webkit-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     -moz-animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
     animation: slide-out-top 0.5s cubic-bezier(0.550, 0.085, 0.680, 0.530) both, 
      }, 1000, function() { 
       { window.location.href = "http:..../work/"; } 
      }); 
    }); 

申し訳ありませんが、私はこの機能が働くことを願っていますが、私は、JSやjQueryのそんなに専門家ではないんですよ! いくつかは私を助けることができます!ありがとうございました!

+0

'animation'をアニメーション????それはちょうど間違っているだけで、そのアニメーションで新しいクラスを追加してから、タイムアウトしてウィンドウに移動します。位置 – DaniP

+0

http://stackoverflow.com/help/how-to-ask –

+0

まず、開発者コンソールエラーの場合。 – Pango

答えて

1

まず、jQueryアニメーションとCSSアニメーションが混在しています。

ここでは、クリックして-500pxでページスプラッシュページをアニメーション表示する簡単なペンを追加しました。うまくいけば、これはあなたが始めるのに役立つことができます。

http://codepen.io/anon/pen/MpOabq

$(".page-splash-page").on("click", function() { 
$(this).animate({ 
    top:'-500px', 
     }, 1000, function() { 
      { window.location.href = 'http://www.google.com' } 
     }); 
}); 
+0

こんにちは@ mrsq、私はRelativeの要素の位置を変更した後、まずあなたのコードの仕事をありがとう。しかし、配線されたものは、アニメーションがかすかなアニメーションであり、滑らかではなく、3つのステップで動きます。 –

+0

マウスホイール、DOMMouseScroll、touchmove、touchstartイベントが互いに干渉している可能性があります。あなたはそれらのすべてを残して、それだけでクリックイベントを試みることができますか? – mrsq

+0

私は試してみましたが、まだうまくいきません...とにかくあなたの答えは私を良い道にしました!私はそれを修正できることを願って! –