Programmatically load dialog in jQuery Mobile?

I am trying to create dialogs in jQuery Mobile that appear when you click the google maps marker.

Example URL: http://cyclestreets.darkgreener.com/location/ (scroll to London, UK to see markers).

I have part of the way with this code:

 google.maps.event.addListener(map_marker, 'click', function() {
     $.mobile.changePage({ url: $("#photo"), data: "id=" + marker.id, type: "GET"}, 'pop', false, true);
 });

But, a few issues with style and data:

+5
source share
3 answers
function openPopup(element_id)
{
    $.mobile.changePage(element_id, { transition: "pop", role: "dialog", reverse: false } );
}
+5
source

Since beta 1 , to get divto display as a dialog, use the attribute data-role="dialog"on divinstead data-role="page".

+1
source

, jquery , . .

<div data-role="dialog" id="dialog" >
<div data-role="header"><h3>Oops!</h3></div>
<div data-role="content">
    <p>You done screwed up, partner!</p>
</div>

</div>
0

All Articles