开发者

jquery image effect not working

开发者 https://www.devze.com 2022-12-13 09:33 出处:网络
Here is my code. The initial fadeTo works, nothing else works. <script type=\"text/javascript\" />

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

精彩评论

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