0
A
回答
0
I have added extra parameter by customizing gritter.js
I have added **notificationID** in popup for my notification popup to close popup dynamically even from database.
**Here is my code**:-
in jquery.gritter.js file.
adding the parameter in gritter option
position: '',
class_name: '', // could be set to 'gritter-light' to use white notifications
fade_in_speed: 'medium', // how fast notifications fade in
fade_out_speed: 1000, // how fast the notices fade out
time: 6000, // hang on the screen for...
**notificationID: ''**
}
// Public - options to over-ride with $.gritter.options in "add"
position: '',
fade_in_speed: '',
fade_out_speed: '',
time: '',
**notificationID: '',**
// adding the dynamic id in dataId....
_tpl_close: '<a class="gritter-close" data-id="[[notificationID]]" href="#" tabindex="1">Close Notification</a>',
//Put in Basics
notificationID = params.notificationID || '';
//define in temp
tmp = this._str_replace(
['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]', '[[notificationID]]'],
[title, text, this._tpl_close, image_str, this._item_count, class_name, item_class, notificationID], tmp
);
In your js file like mine was notification.js
$.gritter.add({
title: val.title,
text: val.message,
notificationID: val.notification_id,
sticky: false,
time: '10000'
});
Very simple.Try It
+0
請添加解釋,因爲不鼓勵使用代碼解答。 – namezero
相關問題
- 1. Jquery Gritter設置的位置
- 2. Gritter titles,text,image
- 3. Rails Gritter Ajax設置
- 4. Swing通知像jquery通知
- 5. jQuery通知欄
- 6. jquery通知(onload)
- 7. 顯示通過jQuery通知
- 8. jQuery通知插件
- 9. jquery錯誤通知
- 10. Rails,Gritter - 刪除默認標題
- 11. JQuery Pines通過關閉按鈕通知永久通知?
- 12. jQuery隱藏個人通知
- 13. MVC4 + jQuery淡出通知div
- 14. PHP/jQuery通知系統
- 15. 快速和髒通知JQuery
- 16. jQuery的即時通知
- 17. Jquery訪客通知箱
- 18. jQuery飛行通知器
- 19. jQuery - 通知庫 - 輪詢
- 20. 隱藏Jquery通知欄
- 21. 檢測新通知的jQuery
- 22. CakePHP通知系統與jquery
- 23. jquery通知彈出窗口 - jquery和updatepanels
- 24. Rails 4在js視圖中呈現Gritter消息
- 25. 通知
- 26. kNetworkReachabilityChanged通知API的通知
- 27. 通知服務通知
- 28. Android onCreate()未通知通知
- 29. Jquery使通知像網絡發送
- 30. jQuery Mobile彈出窗口/通知
什麼通知?你需要把它放在你的問題中。 –