Linux, WebDev and other…

Alert popup view for Backbone with jQuery Mobile

Here is a backbone view for alert popups in jquery mobile. General information about mixing backbone with jquery mobile is here. I just use it like bootstrap, but in the end of render function I manually call $el.trigger(‘create’) to initialize markup (I don’t have fancy page transitions).


Underscore template:

CSS Part (background color):


Example usage:

Popup container must be specified somewhere in DOM (I use empty div). Alternatively, you can specify your own el in constructor options). Whole example is written for requirejs, but here is standalone minimal demo:





, , ,

Leave a Reply

Your email address will not be published. Required fields are marked *