【发布时间】:2016-08-04 19:32:05
【问题描述】:
我正在使用 grinter.js 来通知成功或错误消息。它可以工作,但“X”关闭图标仍然隐藏。我检查了元素的 CSS 规则,它们都可以,但没有效果。
<script src="/components/jquery.gritter/js/jquery.gritter.js"></script>
<link rel="stylesheet" href="/components/jquery.gritter/css/jquery.gritter.css" />
/*some other code*/
switch (window.location.hash) {
case "#success":
$.gritter.add({
title: 'Molto bene!',
text: "L'operazione è stata eseguita con successo!",
sticky: true,
class_name: 'gritter-success gritter-light'
});
break;
case "#error":
$.gritter.add({
title: 'Oops!',
text: "Qualcosa è andato storto. L'operazione non è stata eseguita!",
class_name: 'gritter-error gritter-light'
});
break;
}
js 生成一个图标,如:
<a style="display: none;" class="gritter-close" href="#" tabindex="1">Close Notification</a>
而css规则是:
.gritter-light .gritter-close {
background-image: none;
color: #444;}
//applied onhover
elemento {
display: block;}
【问题讨论】:
标签: javascript jquery html css gritter