How to implement gmail compose window concept in Single Page Applications?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 10:06:08

问题


  • I am working on a project where it would be easier for users to quickly add transactions.

  • I am very much interested to do something similar to what gmail compose pop up does on the single page

  • I have no idea how to implement such a thing. Please give me directions about how to do such things

  • I am interested in building it using AngularJS

P.S Sorry for a broad question, but I really don't know what this is called and don't know what to Google for either


回答1:


You can construct a popup like that very easily using a regular div element and some CSS. In particular, the position: fixed CSS property will let you put something at a position on the window, no matter how it scrolls.

Here is a simple JSFiddle that demonstrates the technique: http://jsfiddle.net/BinaryMuse/ndr2Q/

You can click the titles of the books to expand their description, which will hopefully make the preview window tall enough to scroll. (If not, just resize the window.) No matter where in the document you scroll, the "popup" window (which is just a regular element with an ng-show and some CSS) stays at the bottom-right of the screen.

You can find libraries, like Bootstrap, that present jQuery plugins to allow you to do popups on the page, but in general they're designed to prevent the user from interacting with the page behind the modal in any useful way. A technique like this allows you to scroll around and use the page in the background similar to Gmail's interface.




回答2:


Dockmodal is a Gmail like dockable modal plugin that has the option to minimize and restore opened modal dialogs.




回答3:


Check out these angular JS alerts based on bootstrap:

http://mgcrea.github.io/angular-strap/#/alerts

You can use the provided $modal service that takes a template URL as well :

var modal = $modal({template: '/js/app/views/elements/modal-welcome.html', show: true, backdrop: 'static'});

And shows it up as a popup.



来源:https://stackoverflow.com/questions/16888171/how-to-implement-gmail-compose-window-concept-in-single-page-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!