开发者

html5 showNotification

I have created a desktop notification with window.webkitNotifications.cre开发者_StackOverflowateNotification(). I've seen that gmail use an onclick event on the notification for the redirection, how is it made?


i have found the solution:

var notification = window.webkitNotifications.createNotification(url,title,teaser); 
notification.onclick = function(x) { window.focus(); this.cancel(); $(location).attr('href',path);};
notification.show();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜