6
我想要的错误显示如何让我的错误消息淡出?在RubyOnRails 3
flash[:error] = "Invalid username/password combination."
我已经试过
$(document).ready(function() {// When the Dom is ready
$('.error').hide();//Hide the div
$('.alert').hide();
$('.notice').hide();
$('.success').hide();
$('.info').hide();
$(".error").fadeOut(2000); //Add a fade out effect that will last for 2000 millisecond
$(".alert").fadeOut(2000);
$(".notice").fadeOut(2000);
$(".success").fadeOut(2000);
$(".info").fadeOut(2000);
});
,但没有成功。我已经包括JavaScript文件
<%= javascript_include_tag 'jquery-1.3.2' %>
动态加载错误吗? – Eric
有jQuery 1.6.2,但这并不重要,打开控制台,你应该看看是否有任何错误,这应该,本身,工作。检查你的HTML也(如果它有正确的类值)。 –