VOOZH about

URL: https://www.geeksforgeeks.org/jquery/jquery-mobile-dialog-overlaytheme-option/

⇱ jQuery Mobile Dialog overlayTheme Option - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

jQuery Mobile Dialog overlayTheme Option

Last Updated : 26 Jan, 2022

jQuery Mobile is a web-based technology designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. Dialog is used as a pop-up & can be used on any page to convert it into a modal dialog.

In this tutorial, we are going to learn the jQuery Mobile Dialog overlayTheme Option. The dialog always appears over an overlay layer whose colour scheme can be set with the help of the overlayTheme option.

Syntax: The overlayTheme option takes a single character from a-z where each character represents a color scheme. The option is initialized as follows:

$("#gfgDialog").dialog({
 overlayTheme: "b",
});
  • Get the overlayTheme option

    var overlayThemeOpt = $("#gfgDialog")
     .dialog("option", "overlayTheme");
  • Set the overlayTheme option

    $("#gfgDialog").dialog("option", "overlayTheme", "b");

CDN Links: Use the following CDN links for the jQuery Mobile project.

<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

Example: In the following example, we have set the overlayTheme option to dark using character "b".

Output

👁 jQuery Mobile Dialog overlayTheme Option
jQuery Mobile Dialog overlayTheme Option

Reference: https://api.jquerymobile.com/dialog/#option-overlayTheme

Comment

Explore