AJAX/jQuery 和 Chrome 的奇怪行为
我认为检查问题的最佳方法是访问它:
打开页面,它应该加载底部的行 Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - Unknown Date 感谢这个 jQuery 脚本:
$.ajax ({
url: "list/browse_ajax.php",
type: "POST",
success: function(data) {
$('#browseList').html(data);
},
error: function(data) {
$('#browseList').html("Error");
}
});
在服务器上,它回复:
<script type="text/javascript">
$(document).ready(function() {
$('.lists').mouseover(function() {
$(this).css("background-color", "#CCCCCC");
});
$('.lists').mouseout(function() {
$(this).css("background-color", "#FFFFFF");
});
});
</script>
<div class="lists">
<a class="lblackb" href="index.php?explore=view&trackid=888"><?=htmlentities("Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - Unknown Date", ENT_QUOTES, "UTF-8")?></a>
</div>
用这个列表类:
.lists{width:710px; float:left; border-bottom:1px #000000 solid;}
这是browseList div:
.content{width:710px; float:left; color:#000000; font-weight:normal; text-align:left; margin-left:13px; margin-right:13px;}
<div class="content" id="browseList"> </div>
但是您可以看到,直到您不使用鼠标移动到div上(应用jQuery鼠标悬停/移出效果),您可以看到整行(至少,当我加载页面时,我只看到一小部分Vierge Effarouchee Marnaise - Unknown Date。
只有在 Chrome (8.0.552.237) 下才会出现这种情况,
为什么会这样?我该如何解决这个问题呢?谢谢
P.S. 仅当我在 #browseList' div 中写入 1 行(使用 .html()
)时才会发生这种情况。我只是在该行之前或之后添加一个
,这不会发生:O
P.S.2 我还注意到,如果我多次刷新页面,有时看起来没问题,有时会出现问题...真的很奇怪!我认为这是 Chrome 的一个错误...
I think the best way to check the problem is to visit it :
Opening the page, it should load the line in the bottom Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - Unknown Date thanks to this jQuery script :
$.ajax ({
url: "list/browse_ajax.php",
type: "POST",
success: function(data) {
$('#browseList').html(data);
},
error: function(data) {
$('#browseList').html("Error");
}
});
on the server, it reply with :
<script type="text/javascript">
$(document).ready(function() {
$('.lists').mouseover(function() {
$(this).css("background-color", "#CCCCCC");
});
$('.lists').mouseout(function() {
$(this).css("background-color", "#FFFFFF");
});
});
</script>
<div class="lists">
<a class="lblackb" href="index.php?explore=view&trackid=888"><?=htmlentities("Alptraum - La Vie Fascinante D'Une Jeune Vierge Effarouchee Marnaise - Unknown Date", ENT_QUOTES, "UTF-8")?></a>
</div>
with this lists class :
.lists{width:710px; float:left; border-bottom:1px #000000 solid;}
and this is the browseList div :
.content{width:710px; float:left; color:#000000; font-weight:normal; text-align:left; margin-left:13px; margin-right:13px;}
<div class="content" id="browseList"> </div>
But how you can see, until you don't go on the div with the mouse (applying the jQuery mouseover/out effect), you can see the whole Line (at least, when I load the page I only see a small part as Vierge Effarouchee Marnaise - Unknown Date.
This happens to me only with Chrome (8.0.552.237)
Why this? And how can I fix this trouble? Thanks
P.S. This happens only if I wrote 1 line in the #browseList' div (with .html()
). So for example if I just add a <br/>
before or after that line, this doesnt happens :O
P.S.2. I've also notice that If i refresh the page many times, sometimes it appair OK, sometimes with the problem... really STRANGE! I think it's a Chrome bug...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你 div 类 列表 不需要
I thing you div class lists do not need