0

I am new to phonegap.I want display dialogs in application.How can i display dialog .I have goggled for tutorials but i am not able to find.Please any one please give guidance or tutorials to display dialogs.Thanks in advance....

user1651572
  • 763
  • 1
  • 7
  • 13
  • 1
    Maybe try reading the Phonegap documentation first http://docs.phonegap.com/en/2.0.0/cordova_notification_notification.md.html#Notification – jb11 Sep 20 '12 at 10:27

4 Answers4

6

Use

alert("on device ready!!!!");

or

navigator.notification.alert("PhoneGap is working");
Chirag
  • 56,621
  • 29
  • 151
  • 198
3

You could use Fancybox javascript to do this:

Fancybox javascript

You can create dialogs with everything you need inside.

Aitul
  • 2,982
  • 2
  • 24
  • 52
mram888
  • 4,899
  • 5
  • 33
  • 59
1

I've made dialogs by using absolutely positioned <div> which show or hide depending whether dialog is open or closed.

In my index.html

<div id="hellodlg" class="dialog hidden">
Hello
<button class="closedlg">close</button>
</div>
<button class="openclosedlg">open/close</button>

in style

<style>
.dialog {
position:absolute;
left:50%; // position in the middle
margin-left: -5em; // move left so that dialog is in the middle
top: 2em;
width: 10em;
height:10em;
background:blue;
border: 1px solid black:
}

.hidden {
display:none;
}
</style>

in script using jquery (see how to add class without jquery)

<script>
// open dialog
$(".openclosedlg").click(function() { $(".dialog").toggleClass("hidden");});

// listen for button
$(".closedlg").click(function() { $(".dialog").addClass("hidden");});
</script>

Here is a complete example

Community
  • 1
  • 1
CodeBro
  • 209
  • 1
  • 4
0

Use JQM

as a designing framework which is most suitable companion for phonegap.

Abdulqadir_WDDN
  • 658
  • 6
  • 22