0

您好,我需要能够确定给定的类是否已经“淡入”:

private void fadeIn() {
        // TODO: Check first if class is already shown! otherwise, don't run this as it fade's out when it is run over a already faded in class
        $(".hopscotch-bubble").fadeIn(new com.google.gwt.query.client.Function() {
            @Override
            public void f() {
                JSNIHelper.infoNotify("INFO", "Fade in method invoked.");
            }
        });
    }

我怎么做?

4

2 回答 2

1

gwtquery fadeIn finishes showing a hidden element so $(selector).visible() should return whether the element is visible.

But normally, if you want to take care of not running two animations, the normal way in gquery and jquery is stop all pending animations.

$(selector).stop(true).fadeIn(...);
于 2014-03-06T14:40:34.870 回答
1

无论如何我都不知道java,这个概念是分配一个变量并检查该变量是否为真,如果为真,则调用如下函数:

private void fadeIn() {
        // TODO: Check first if class is already shown! otherwise, don't run this as it fade's out when it is run over a already faded in class
var faded = 1;
if(faded){ 
faded = 0;       
$(".hopscotch-bubble").fadeIn(new com.google.gwt.query.client.Function() {
            @Override
            public void f() {
                JSNIHelper.infoNotify("INFO", "Fade in method invoked.");
            }
        });
    }

}

于 2014-03-06T09:04:51.010 回答