本文介绍了Laravel 5.2浏览器中的弹出用户通知-示例,提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个吉他课程网站,我想在其中实时或近实时地向用户(访客或登录用户)通知有关新通知的信息.我遵循以下示例:

I have a guitar lessons site where I want to notify users (guests or logged in) about new notifications in real or near real time. I followed this example:

https://blog.pusher.com /writing-realtime-apps-with-laravel-5-and-pusher

我已经设置了一个活动,我拥有了推送者帐户,并且我按上面的链接所述进行了某些工作.

I have an event set up, I have pusher account, I have things working as described in the above link.

但是...我想让通知显示出通知在许多其他网站上的显示方式.即,无论用户在当前页面上的滚动位置如何,浏览器的右下角都会出现一个小弹出窗口.也许不管浏览器在何处滚动,消息栏都会出现在浏览器顶部.无论如何,我都找不到这种方式的5.2通知示例.我所看到的只是在刀片文件中使用消息div并通过刀片中的pusher代码填充div的示例.因此,我想做我想做的事情在精神上是相似的,只是需要一些尚不清楚的额外前端步骤.

But... I would like to have the notifications show up the way notifications appear on a lot of other sites. Namely, where a small popup appears on bottom right corner of browser regardless of where user is scrolled on current page. Or maybe where a message bar would appear on top of browser regaardless of where user is scrolled. In any case, I can't find examples of 5.2 notifications in this manner. All I see are examples of using a message div in a blade file and having the div populated via the pusher code in the blade. So I imagine to do do what I want is similar in spirit, just requiring some extra front end steps that are not clear to me yet.

提示,值得赞赏的例子!

Tips, examples appreciated!

谢谢

推荐答案

那么您可以使用通用的laravel刀片文件(带有推入代码),并在所有刀片模板中继承该文件.现在使用jquery growl( http://ksylvest.github.io/jquery-growl/ )或您选择的警报框,您可以在所需的任何页面上显示弹出窗口.

Well you can use a common laravel blade file (with pusher code) and inherit that file in all blade templates.Now using jquery growl (http://ksylvest.github.io/jquery-growl/) or alert box of your choice you can show the popups on any page you want.

这篇关于Laravel 5.2浏览器中的弹出用户通知-示例,提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 08:51