1

对于大学作业,我必须在 Adob​​e 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();

  });
4

1 回答 1

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
于 2012-12-29T15:08:48.143 回答