PopupNotification JavaScript XUL 中的超时问题
该代码适用于我显示门衣架弹出窗口。但是,当我想在选项下使用超时时,它不会显示弹出通知。
语法:
Notification show(browser,id,message,anchorID,mainAction,secondaryActions,options);
我的代码:
PopupNotifications.show(gBrowser.selectedBrowser, "PDE-popup",
"Hi, there!, You can Build a PaDE by clicking on the PDE button!!",
null, /* anchor ID */
{
label: "Build PDE",
accessKey: "D",
callback: function() {
if(nodeSRC!=null) pde.emptyNodeSRC(nodeSRC);
window.openDialog("chrome://PDE/content/PDEBuilder.xul", "hello", "chrome,width=400,height=360",userContent, nodeSRC);
}
},null, { timeout: Date.now() + 10000,
persistWhileVisible: false });
1.这段代码有什么问题? 2. 如何将此门挂钩弹出窗口显示在我的工具栏按钮上? 这是工具栏按钮
<toolbarbutton id="pde-toolbar-button" label="Detect"/>
我想在10秒内消失弹出通知!谢谢你们。
我没有辅助选项,所以我将其设置为空,但超时不起作用。
http://scenari-platform.org/ svn/dev-core/trunk/Lib_XulRunner/Darwin/modules/PopupNotifications.jsm
This code working for me to display the door-hanger popup. But, when I want to use the time-out under the options it wont show up the pop-up notification.
Syntax:
Notification show(browser,id,message,anchorID,mainAction,secondaryActions,options);
My code:
PopupNotifications.show(gBrowser.selectedBrowser, "PDE-popup",
"Hi, there!, You can Build a PaDE by clicking on the PDE button!!",
null, /* anchor ID */
{
label: "Build PDE",
accessKey: "D",
callback: function() {
if(nodeSRC!=null) pde.emptyNodeSRC(nodeSRC);
window.openDialog("chrome://PDE/content/PDEBuilder.xul", "hello", "chrome,width=400,height=360",userContent, nodeSRC);
}
},null, { timeout: Date.now() + 10000,
persistWhileVisible: false });
1.What's wrong with this code?
2. How can I place this door hanger popup to be displayed on my tool bar button?
This is the tool bar button
<toolbarbutton id="pde-toolbar-button" label="Detect"/>
I want to disappear the pop-up notification in 10Seconds! Thank u guys.
I have no secondary options so, I made it null but the time-out is not functioning.
http://scenari-platform.org/svn/dev-core/trunk/Lib_XulRunner/Darwin/modules/PopupNotifications.jsm
https://developer.mozilla.org/en/JavaScript_code_modules/PopupNotifications.jsm#Notification_events
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上面的代码工作正常,终于从其他论坛得到了对我的问题的明确解释。
The above code works fine, finally got a clear explanation from other forum for my problem.