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>
精彩评论