Css IE中的jQuery工具提示定位问题
我对IE有问题(真是个惊喜)。我正在我的页面上创建一个问题报告功能(报告不良图像…)。我想用几个问题展示“报告此图像”的简单表单(报告原因…)。它应该在单击报告图像后显示。它在FF和Chrome中都能很好地工作,但IE中存在一个问题。Div应该显示在鼠标点击位置。它第一次显示在正确的位置,但当我关闭它并单击另一个报告图像而不重新加载页面时(站点上有更多报告图像),它会再次显示在它第一次显示的相同位置(仅在IE中)。 这是我的密码:Css IE中的jQuery工具提示定位问题,css,internet-explorer,jquery,Css,Internet Explorer,Jquery,我对IE有问题(真是个惊喜)。我正在我的页面上创建一个问题报告功能(报告不良图像…)。我想用几个问题展示“报告此图像”的简单表单(报告原因…)。它应该在单击报告图像后显示。它在FF和Chrome中都能很好地工作,但IE中存在一个问题。Div应该显示在鼠标点击位置。它第一次显示在正确的位置,但当我关闭它并单击另一个报告图像而不重新加载页面时(站点上有更多报告图像),它会再次显示在它第一次显示的相同位置(仅在IE中)。 这是我的密码: $(document).ready(function(){
$(document).ready(function(){
$(".proofreporter").click(function(e){
$('.popup').remove(); //used to remove previously shown elements
$.ajaxSetup ({
// Disable caching of AJAX responses
cache: false
});
// setTimeout(function(){$('.popup').remove()},2000);
var name = $(this).attr('id');
function showData(data) {
$("body").append(data);
}
//x = e.pageX; first I tried this to get position but same result
//y = e.pageY;
var pos = $(this).offset();
x=pos.left;
y=pos.top;
alert(x + 'x' + y);
$.get('includes/reporter.php?reportimgdiv=' + name + '&x=' + x + '&y=' + y, showData);
});
});
下面是reporter.php的代码
if(isset($_GET['reportimgdiv']))
{ //report IMAGE
?>
<style type="text/css">
.popup { //SOLVED; change to this: #<?echo report$_GET['reportimgdiv']?>
position: absolute;
left: <?echo $_GET['x'];?>;
top: <?echo $_GET['y'];?>;
z-index: 100;
width: 280px;
}
.subtle {
margin: 0px;
padding: 5px;
border: 2px solid gray;
font-size: small;
text-align: left;
background-color: #EEE;
color: #444;
}
</style>
<?
$imgid=$_GET['reportimgdiv'];
?>
<div id="reportForm001" class="popup" style="margin-top: 0em; "> //solved: change id="report<?echo $imgid?>"
<!--
<form name="form1" method="post" target="reportframe" action="update/pagereportframe.php" class="subtle" style="position: relative; left: 1em; top: 2px;">
-->
<form name="form1" method="post" target="reportframe" action="includes/reporter.php" class="subtle" style="position: relative; left: 1em; top: 2px; background-color: white" >
<input name="id" type="hidden" value="<?echo $imgid; ?>">
<div style="position: absolute; right: 1em; font-size: x-small"><a href="#" onClick="jQuery('.popup').remove();">CLOSE [X]</a></div>
<h3>What is wrong with this image? <?echo $_GET['x'];?> X <?echo $_GET['y'];?> </h3>
<input type="radio" name="reason" value="1"> BLAH BLAH/b>. <br>
<input type="radio" name="reason" value="2"> BLAH BLAH/b>. <br>
<br>Comment (optional):<br>
<textarea name="comment" rows="3" style="width: 100%"></textarea><br>
<input value="Submit" type="submit">
</form>
</div>
<?
}
if(isset($\u GET['reportimgdiv']))
{//报表图像
?>
.popup{//已解决;更改为:#
位置:绝对位置;
左:;
顶部:;
z指数:100;
宽度:280px;
}
.微妙{
边际:0px;
填充物:5px;
边框:2倍纯色灰色;
字体大小:小;
文本对齐:左对齐;
背景色:#EEE;
颜色:#444;
}
//已解决:更改id=“报告”
X
废话废话/b>
废话废话/b>
注释(可选):
解决了的
我使用now ID(而不是class)来标识弹出div。有关更多信息,请参见reporter.php代码注释您可以发布自己的答案并标记为