1

我希望在设定的时间内显示警告并使其以良好的效果消失(慢慢变为透明并最终消失),您能帮我使用什么技术!我猜 AJAX 或 javaScript 可以做到吗?

我现在使用的警告是:

<script type="text/javascript" language="javascript">
function enableWarning_feedbackSent()
{
    var warn = $('<label style="color:Red;font-size:12px;font-family: Verdana;">Thank you for your feedback!</label>');
    $('.warning_feedback').text('').append(warn);   
    return true;
}
</script>

提前致谢!

4

1 回答 1

1

Try this:

function enableWarning_feedbackSent()
{
    var warn = $('<label style="color:Red;font-size:12px;font-family: Verdana;">Thank you for your feedback!</label>');
    $('.warning_feedback').text('').append(warn); 
    $('.warning_feedback').find('label').fadeOut(3000);   //new line, 3000 is milliseconds, you can change this value
    return true;
}

You could also just change the .text() of $('.warning_feedback'), without append; and make in fade out/disapear -> add new text -> fade in/out

于 2013-10-14T16:27:16.713 回答