View Full Version : dialog pop up from list item possible?

01-23-2012, 09:19 AM
Is it possible to make a dialog pop up from a jQuery mobile list the same way it's possible from an object like this?:

<a href="#imgshow" data-transition="pop" data-rel="dialog">
<img src="../images/1DV.jpg" alt="imgname.jpg"/>

Here's my list html (one list item):

<li class="ui-btn ui-btn-icon-right ui-li-has-arrow ui-li ui-btn-up-c">
<div class="ui-btn-inner ui-li">
<div class="ui-btn-text">
<a class="ui-link-inherit" href="#imgshow" data-transition="pop" data-rel="dialog">imgname.jpg
<img src="../images/imgname.jpg" alt="imgname.jpg"/></a>

And here's my jQuery that calls the dialog:

$('.gallerycontent img').bind('tap',function(event, ui){
var src = $(this).attr("src");
var alt = $(this).attr("alt");
$('#dialogcontent').empty().append('<a href="#gallerypage"><img src="' + src + '" style="width:100%;"/></a>' );
$('#dialoghead').empty().append('<center><h2>' + alt + '</h2></center>' );

Thankful for suggestions on how to solve this!

01-25-2012, 03:05 PM
Maybe this isn't the right forum for my problem... I got the answer in another forum if anyone's interested: