我有一个带有0不透明度背景的div #test,我想要动画它直到达到0.7的不透明度.但.animate似乎不适用于css rgba.
我的css是:
#test {
background-color: rgba(0, 0, 0, 0);
}
Run Code Online (Sandbox Code Playgroud)
我的HTML:
<div id="test">
<p>Some text</p>
<img src="http://davidrhysthomas.co.uk/img/dexter.png" />
</div>
Run Code Online (Sandbox Code Playgroud)
和我的jQuery:
$('#test').animate({ background-color: rgba(0, 0, 0, 0.7) },1000);
Run Code Online (Sandbox Code Playgroud)
这里有一个jsFiddle:http://jsfiddle.net/malamine_kebe/7twXW/10/
非常感谢你的帮助!
我想在不离开当前页面的情况下发送表单,所以我正在使用:
$('.myForm').on('submit', function(){
$.ajax({
url: $(this).attr('action'),
type: $(this).attr('method'),
data: $(this).serialize(),
success: function(html) {
alert('ok');
}
});
return false;
});
Run Code Online (Sandbox Code Playgroud)
但它不起作用...请问任何想法?