[background.png] [1] [card.png] [2] このcard.pngをボタンに表示して、背景イメージがマウスオーバーとマウスで移動します。なぜ私のイメージはアニメーション化していません
<style type="text/css">
#tb_whisper {
background-image:url("background.png") !important;
}
.tb_send {
background:-moz-linear-gradient(center bottom , #000000 0%, #B8B6B6 100%) repeat scroll 0 0 transparent;
border:1px solid red;
color:#FFFFFF;
cursor:pointer;
float:left;
height:28px;
margin-right:4px;
}
.ui-corner-all {
-moz-border-radius:4px 4px 4px 4px !important;
}
.toolbar {
-moz-border-radius:0 0 4px 4px;
background:-moz-linear-gradient(center bottom , #000000 0%, #B8B6B6 100%) repeat scroll 0 0 transparent;
height:28px;
vertical-align:middle;
padding:4px 0;
}
.tb_nav {
border:1px solid #FFFFFF;
cursor:pointer;
float:left;
height:28px;
margin-right:4px;
width:28px;
}
button::-moz-focus-inner {
border:0;
padding-top:0;
}
</style>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type='text/javascript'>
$(document).ready(function(){
$('.tb_nav')
.mouseover(function(){
$(this).animate(
{'backgroundPosition':"(-36px 0px)"},
{'duration':500});
})
.mouseout(function(){
if(!$(this).hasClass('tb_nav_active')) {
$(this).animate(
{'backgroundPosition':"(0 0)"},
{'duration':500});
}
});
});
</script>
</head>
<body>
<button style="background-position: 0px 0px;" id="tb_whisper" title="Whisper" class="tb_nav ui-corner-all">
</button></html>![alt text][3]
[backgrund]: http://i.stack.imgur.com/JEbd4.png
[card ]: http://i.stack.imgur.com/So7Re.png
[3]: http://i.stack.imgur.com/18jx0.pn
グラム
私は答えを最初に与えたsytanxを変更してください...ちょうど冗談です。 – kobe