对于大学任务,我必须在Adobe Edge Animate中为Smegg冰箱开发一个产品站点。我的问题是我希望徽标在完全不透明度之间具有恒定的不透明度转换,比如让我们说30%,然后回到100%,这会循环整个时间。我写了一些jQuery代码,但它不起作用。抱歉我的英语不好,不是我的母语。这是代码:
//Edge symbol: 'stage'
(function(symbolName) {
Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {
// insert code to be run when the composition is fully loaded here
var timer = $.timer(logoHandler, 1000);
function logoHandler() {
var state = true;
if ( state ) {
$( "#smegLogo" ).animate({
opacity: 0.3
}, 500 );
} else {
$( "#smegLogo" ).animate({
opacity: 1
}, 500 );
}
state = !state;
};
timer.play();
});
答案 0 :(得分:1)
这样的东西?
http://jsbin.com/abecoz/1/edit
var c=0;
var op = [ '0.3' , '1' ];
function loopLogo(){
$("#smegLogo").animate({opacity: op[c++%2]},400, loopLogo); // <- ani. callback
}
loopLogo(); // start loop