0
遍历数组,我打印每个迭代的div内容。 只要用户点击任何div内容,就会出现一个弹出窗口,并在数组弹出框中显示相应的内容。弹出的问题:没有显示正确的相应内容
下面是我的代码,
foreach ($email as $client)
{
echo "<div class = 't'> Show more....... </div>";
echo "<div class='popup_msg'>";
echo $client['Email']['body'];
echo "</div>";
}
javascript代码如下
jQuery(document).ready(function(){
jQuery('.t').click(function(e)
{
var height = jQuery('.popup_msg').height();
var width = jQuery('.popup_msg').width();
leftVal=e.pageX-(width/1.5)+"px";
topVal=e.pageY-(height/13)+"px";
jQuery('.popup_msg').css({left:leftVal,top:topVal}).show();
});
jQuery('.popup_msg').click(function(e)
{
jQuery('.popup_msg').fadeOut('fast');
});
});
在上面的代码
,我想要实现的是,每当用户点击与T类股利时,相应的客户端$ [“电子邮件”] [“身体”]应该出现在弹出