开发者

jquery image effect not working

Here is my code. The initial fadeTo works, nothing else works.

<script type="text/javascript" />

$(document).ready(function() {

$('#ButtonBGanim').fadeTo('fast',0.5);
        $('#ButtonBGanim').mouseenter(function() {
 开发者_Python百科       $(this).fadeto('fast',1.0)


        }).mouseleave(function(){
        $this.fadeto('fast', 0.1);
        });
    });


</script>

<DIV id="ButtonBGanim">                    </DIV>


Should be fadeTo, not fadeto.

Should be $(this), not $this.

<script type="text/javascript" />
$(document).ready(function() {
    $('#ButtonBGanim').fadeTo('fast',0.5);
    $('#ButtonBGanim').mouseenter(function() {
        $(this).fadeTo('fast',1.0);
    }).mouseleave(function() {
        $(this).fadeTo('fast', 0.1);
    });
});
</script>


In your original code you may have misspelled fadeTo() but you can also try hover like this:

<script type="text/javascript" />

$(document).ready(function() {

        $('#ButtonBGanim').fadeTo('fast',0.5);
        $('#ButtonBGanim').hover(function() {
        $(this).fadeTo('fast',1.0)


        },function(){
        $(this).fadeTo('fast', 0.1);
        });
    });


</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜