我有这个 :
<div class="wrapper">
<div class="left1">
<div id="position" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;"class="PopupDiv";>Position 1<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
<div class="left2">
<div id="position" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;"class="PopupDiv";>Position 2<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true,'offsetTop':-200});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
<div class="left3">
<div id="poistion" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;"class="PopupDiv";>Position 3<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true,'offsetTop':-200});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
<div class="left4">
<div id="position" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;top:50%;left:50%;margin:-(height/2)px 0 0 -(width/2)px;"class="PopupDiv";>Position 4<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true,'offsetTop':-200});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
<div class="left5">
<div id="position" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;"class="PopupDiv";>Position 5<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true,'offsetTop':-200});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
<div class="left6">
<div id="position" style="background-color:yellow;border:1px solid black;display:none;width:200px;height:200px;"class="PopupDiv";>Position 6<br>Price x<br>Available on xx-xx-xx<br><a href="http://flibay.com/buy.php";>Buy;</a></div>
<a href="#" onclick="Popup.show('position','reference','center center',{'constrainToScreen':true,'offsetTop':-200});;return false;">Details;</a><br>
<img src="img/banner_1.jpg">
</div>
</div>
它是以 div 为中心的 javascript 弹出窗口,但如果我点击了这 6 个 div 中的任何一个,请在弹出的 onlu 内容中获取 ID 为“position”的第一个 div。如何仅获取我单击的那些 div 的内容?PS Javacript popup.js 来自此链接的我的修改http://www.javascripttoolbox.com/libsource.php/popup/combined/popup.js