以下是其中一个代码:
$("#submit").click(function(){
if (message == '') {
$('#incorrmess').html('<img src = "wrong.png"/> Please type in your message').slideDown("slow");
} else {
//Ajax statement
}
});在页面的主体上,我有div。效果不起作用。我还尝试了这个:
$('#incorrmess').slideDown("slow").html('<img src = "wrong.png"/> Please type in your message');我该怎么做才能让特效发挥作用?
谢谢。
发布于 2012-12-20 16:34:04
你应该先隐藏,然后再slideDown。可见元素上的slideDown不会执行任何操作。
$('#incorrmess').hide().html('<img src = "wrong.png"/> Please type in your message').slideDown("slow");
发布于 2012-12-20 16:37:38
您还可以将div设置为display:none;,然后尝试使用$('#incorrmess').html('<img src = "wrong.png"/> Please type in your message').slideDown("slow");。也可以查看这个简单的example
https://stackoverflow.com/questions/13967930
复制相似问题