GreenSock, TweenLite 動かない時

デモ:

https://codepen.io/GreenSock/pen/GFBvn

 

問題:

2回目以降のレンダリング(ハイブリッドアプリの該当画面の表示)ではTweenLiteオブジェクトの配置が何も指定されていないのと同じようになる

 

解決策:

JavaScriptでのオブジェクトマークアップをなくし、すべてのスタイリングをCSSで行う

Javascriptファイルのなか:

// TweenLite.set($container, {height: 90+"%", width: 100+"%"});
// TweenLite.set($coin, {width:30+"%", height:10+"%", lineHeight:10+ "%"});
// TweenLite.set($sensor, {width:50+"%", height:50+ "%", lineHeight:1+ "%"});

TweenLite.set($container, {});
TweenLite.set($coin, {});
TweenLite.set($sensor, {});

 

 問題:

2回目以降のレンダリング(ハイブリッドアプリの該当画面の表示)ではdragが使えない(ことがある)

・Position: absolute を用いてオブジェクトを再配置する

 

問題:

2回目以降のレンダリング(ハイブリッドアプリの該当画面の表示)ではhitTestが使えない

 

もともとのコード例

if (Draggable.hitTest('#test')) {
    console.log('hit');
}

 

 

解決策の案:

hitTest = this.hitTest("#drop1", e);

greensock.com

 
function hit_test(){
if(this.Draggable.hitTest($sensor, overlapThreshold)){console.log('hit')}
}

 

=> Uncaught Error: Syntax error, unrecognized expression: 50% 

 

overlapThesholdの値がunrecognized.

 

原因候補

備忘6 » Post Topic » jQuery mobileでリロードしないとJavascriptが動かない場合

 

・onModal Show

Event after Modal show - Ionic

 

「実行タイミングがクイックビュー機能により意図的に変更される?」 

 

参考

http://greensock.com/forums/topic/14745-animation-lagging-sometimes/

http://greensock.com/forums/topic/1960-tweens-not-always-completing/

http://greensock.com/forums/topic/10964-bug-report-with-rotate180deg-tweenmax-sometimes-does-the-wrong-matrix-conversion/

 

 

他のサイト

 

・キャッシュのせいでajaxが二回目以降動かない

IEでAjaxのスクリプトが初回処理後に動かない原因!一時ファイルの設定で解決する方法! | 自作PCテクニカルセンター