現在の要素の代わりにユーザーがクリックした最後の要素を示すポップアップウィンドウに問題があります。私はユーザーが印刷するためにクリックすることができるいくつかの異なるクーポンを持っています。たとえば、ユーザーが "test"というIDのクーポンをクリックした場合、何も起こりませんが、ユーザーがもう一度クリックするとクーポンが表示されます。この場合、クーポンがクリックされても「テストクーポン」は表示され続けます。ページを手動でリフレッシュすると、ユーザーは新しいクーポンをクリックできます。私は間違って何をしていますか?ポップアップウィンドウのJqueryの問題
$(".coupon").click(function() {
var id = $(this).attr("id");
$('.pop').popupWindow({
windowURL:'coupons/' + id + '.html'
});
});
.coupon {
margin:10px;
height:152px;
width:193px;
position:relative;
cursor:pointer;
float:left;
}
.coupon .price {
margin-top:7px;
font-size:29px;
font-weight:bold;
color:white;
text-align:center;
}
.coupon .title {
margin-top:5px;
font-size:18px;
font-weight:bold;
color:black;
text-align:center;
font-family:'Times New Roman',Georgia,Serif;
}
<div class="coupon pop" id="test1">
<div class="price">
$5.00 OFF
</div>
<div class="title">
Test
</div>
</div>
<div class="coupon pop" id="test2">
<div class="price">
$5.00 OFF
</div>
<div class="title">
Another test
</div>
</div>
に変換あなたはプラグインを使っていますか? – Shyju
基本的には問題ないようです。他のコードやjsFiddleを投稿できますか? – j08691
@Shyju、ここからプラグインを使用しています:http://www.swip.codylindley.com/popupWindowDemo.html – Muzz