팝업이있는 페이지가 두 개있을 때 이상하게 작동하는 것 같습니다. jquery 모바일 팝업이 이상하게 작동합니다.
은 내가<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
<script src="libs/jquery.mobile.paramsHandler-1.4.2.js"></script>
<script src="clickdemo.js"></script>
<style>
.thumbnail
{
float: left;
width: 80px;
border: 1px solid #999;
margin: 0 15px 15px 0;
padding: 5px;
text-align:center;
}
.thumbnail img
{
width: 80px;
height: 80px;
}
</style>
</head>
<body>
<div data-role="page" id="Home">
<div data-role="main" class="ui-content">
<a href="#workingPage" class="ui-btn">Working Page</a>
<a href="#brokenPage" class="ui-btn">Broken Page</a>
</div>
</div>
<div data-role="page" id="workingPage">
<div data-role="popup" id="workingImagePopup" data-overlay-theme="b" data-theme="b" data-corners="false">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
<img id="WorkingPopUpPhoto" class="PopPhoto" src="" alt="">
</div>
<div data-role="main" class="ui-content">
<div class="thumbcontainer">
<div class="thumbnail">
<img src="http://www.funnypica.com/wp-content/uploads/2012/05/Funny-UglyMan.jpg" alt="" ><br>
</div>
<div class="thumbnail">
<img src="http://www.funnypica.com/wp-content/uploads/2012/05/Crazy-Face-570x403.jpg" alt="" ><br>
</div>
</div>
</div>
</div>
<div data-role="page" id="brokenPage">
<div data-role="popup" id="brokenImagePopup" data-overlay-theme="b" data-theme="b" data-corners="false">
<a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
<img id="brokenPopUpPhoto" class="PopPhoto" src="" alt="">
</div>
<div data-role="main" class="ui-content">
<div class="thumbcontainer">
<div class="thumbnail">
<img src="http://www.funnypica.com/wp-content/uploads/2012/05/Funny-UglyMan.jpg" alt="" ><br>
</div>
<div class="thumbnail">
<img src="http://www.funnypica.com/wp-content/uploads/2012/05/Crazy-Face-570x403.jpg" alt="" ><br>
</div>
</div>
</div>
</div>
</body>
</html>
을보고하고 무엇을 보여주기 위해 간단한 예제를 만들고 두 페이지가 매우 유사 (절단 만에 붙여 때문에이와 나는 다시 그 코드 최대
$(document).on("pagecreate", "#workingPage", function() {
$(".thumbnail img").click(function (e) {
alert("clicked");
var thumbnailPath = $(this).attr("src");
$('#WorkingPopUpPhoto').attr("src",thumbnailPath); //set the image source of the popup
$('#workingImagePopup').popup('open'); //open the popup
});
});
$(document).on("pagecreate", "#brokenPage", function() {
$(".thumbnail img").click(function (e) {
alert("clicked");
var thumbnailPath = $(this).attr("src");
$('#brokenPopUpPhoto').attr("src",thumbnailPath); //set the image source of the popup
$('#brokenImagePopup').popup('open'); //open the popup
});
});
을 JS ID가 변경됨), 나는 그 (것)들이 동일하게 일할 것으로 예상했다. 이미지를 클릭하면 팝업 이미지 다음에 경고가 표시됩니다. 두 페이지가 동일 할 것으로 예상됩니다. 이미지를 클릭하고 알림을보고 팝업을보십시오.
여기가 내가 겪고있는 것입니다.
나는 작업 페이지 (가정에서 시작하여 "작업 페이지"로 이동)를 방문하면 모든 것이 예상대로 작동합니다. 미리보기 이미지를 클릭하면 경고 및 팝업 이미지가 나타납니다.
나는 홈 페이지로 이동하는 브라우저에서 다시 클릭하여 "깨진 페이지"("작업 페이지"의 복제본)를 클릭하고 동작이 다릅니다. 이미지를 클릭하면 먼저 두 개의 경고 (WHY?)가 나타나고 팝업 이미지가 표시되지 않습니다.
II 다시로드하고 순서를 바꾸면 (즉 : "깨진 페이지"로 시작) 동일한 패턴이 나타나고 깨진 페이지가 작동하며 작동중인 페이지가 깨졌습니다 (마크 업 또는 JS가 아님을 암시 함)
내가 잘못하고 있니?
http://jsfiddle.net/Palestinian/huc1ubs6/ – Omar