需要新鲜眼睛的帮助。试图定位元素。不工作,定位到窗口。在Safari上测试Safari。
<div data-role="content" class="ui-content" role="main">
<ul data-role="listview" class="todo-listview ui-listview">
<li data-row-id="1" class="outstanding ui-li-has-alt ui-first-child">
<a href="" class="view ui-btn" data-view-id="1"></a>
$(document).on('taphold', '.todo-listview a', function() {
console.log("DEBUG - Go popup");
var link_name = $(this).attr('data-view-id');
var $popUp = $("<div/>").popup({
dismissible: true,
theme: "b",
transition: "pop",
positionTo: '#link_name'
}).on("popupafterclose", function () {
//remove the popup when closing
$(this).remove();
});
$("<p/>", {
text: "Test!"
}).appendTo($popUp);
$popUp.popup('open').trigger("create");
});
感谢您的时间。它的确有效。
答案 0 :(得分:0)
2个问题:
将positionTo: '#link_name'
更改为positionTo: '#' +link_name
然后,您需要设置li <li data-row-id="1" id="1"...
这是 DEMO