O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a modal box with buttons

A modal box is similar to a conventional dialog window used by web and desktop applications. It appears as a response to an event. For instance, when a user clicks on a button then the click event is launched. This modal box can contain some buttons to launch different events or actions, and it is useful for offering different choices to the user without leaving the current page. The appearance of the modal box is not the same as the rest of the widget of the page. It is showed with a black background color at the bottom of the page. We will look at the process of building these kind of widgets in this recipe.

Getting ready

We go back to use the UiUIKit framework as it includes a specific widget for building this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required