2017-08-01 6 views
0

現在、私が実行しているCSSベースのken burn effectを使用して表示しているCSSアニメーションの背景画像を取得する方法https://codepen.io/anon/pen/VzYRWV現在、オープンソースのコードを使用してJavaスクリプト

私は、テキストボックスに表示なっている現在の画像を取得する方法を知っていただきたいと思います

上記のデモに示されています。

ご協力ありがとうございます。

+1

[getComputedStyle(https://developer.mozilla.org/en/docs/Web/API/Window/getComputedStyle)は、あなたが探しているものです –

+0

ありがとう..私は試して更新します – Kenny

答えて

0

試してみてくださいこれらのCSS効果https://jsfiddle.net/ipsjolly/cugLbrfu/4/

.parent.rotate:hover .child, .parent.rotate:focus .child { 
    -ms-transform: rotate(7deg); /* IE 9 */ 
    -webkit-transform: rotate(7deg); /* Chrome, Safari, Opera */ 
    transform: rotate(360deg); 
} 
.parent.scalein:hover .child, .parent.scalein:focus .child { 
    -ms-transform: scale(1.2); 
    -moz-transform: scale(1.2); 
    -webkit-transform: scale(1.2); 
    -o-transform: scale(1.2); 
    transform: scale(1.2); 
} 
.parent.scaleout:hover .child, .parent.scaleout:focus .child { 
    -ms-transform: scale(0.9); 
    -moz-transform: scale(0.9); 
    -webkit-transform: scale(0.9); 
    -o-transform: scale(0.9); 
    transform: scale(0.9); 
} 

二つの新しい尺度でを作成し、スケールアウトあなたはjavascript関数でイベントをキャッチすることができます

https://css-tricks.com/zooming-background-images/

0

ソース

Ex。今

// first image 
var img = document.getElementsByClassName('slideshow-image')[0]; 

// fired on animation start 
img.addEventListener("animationstart",function() { 
    // do stuff here 
    console.log("Animation start"); 
},0); 

、これはうまく機能し、それが と、それを行うことになっているどのようなアニメーションが同時にシーケンシャルが、すべてではないので(ないあなた)例はうまく動作しませんが。 (ステップの代わりにパーセンテージを制御する)

しかし、あなたが探しているものをアーカイブするために、そのアイデアを出して遊ぶことができます。

重要な注記:ベンダー接頭辞は引き続き使用されます。

その他の参照:

関連する問題