Safari 中的 jQuery .animate 问题
谁能告诉我为什么这在 Safari 中不起作用?
var el = "#divName";
$(el).prepend($("<div id='" + id + "' style='position: absolute; top: -35px; width: 100%; height: 35px; clear: all;'></div>")
.data("data", o)
.html("<table style='width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; font-family: Arial,Helvetica; font-size: 13px;' cellpadding='0' cellspacing='0'><tr style='position: absolute; top: 0px; left: 0px;'><td style='width: 35px; position: absolute; top: 1px; left: 1px; line-height: 35px;'><img src='" + originImg + "' style='height: 30px; width: 30px;' /></td><td style='position: absolute; width: 800px; height: 35px; left: 38px;'><b>" + o.from + "</b><br />"+o.text+"</td></tr></table>"));
$(el + " > div:first").animate({ top: "+=" + border }, 1000);
$(el + " > div:gt(0)").animate({ top: "+=" + border }, 1000);
$(el + " > div:gt(0)").css("border-top", "1px solid #ccc");
它在 Firefox 中完美运行...在 Safari 中,div 本身向下移动,但 div 内的表格不会随之移动。此外,当我单击文本框时,表格将“弹出到位”。奇怪...有人想猜猜出了什么问题吗?
Can anyone tell me why this doesn't work in Safari?
var el = "#divName";
$(el).prepend($("<div id='" + id + "' style='position: absolute; top: -35px; width: 100%; height: 35px; clear: all;'></div>")
.data("data", o)
.html("<table style='width: 100%; height: 100%; position: absolute; top: 0px; left: 0px; font-family: Arial,Helvetica; font-size: 13px;' cellpadding='0' cellspacing='0'><tr style='position: absolute; top: 0px; left: 0px;'><td style='width: 35px; position: absolute; top: 1px; left: 1px; line-height: 35px;'><img src='" + originImg + "' style='height: 30px; width: 30px;' /></td><td style='position: absolute; width: 800px; height: 35px; left: 38px;'><b>" + o.from + "</b><br />"+o.text+"</td></tr></table>"));
$(el + " > div:first").animate({ top: "+=" + border }, 1000);
$(el + " > div:gt(0)").animate({ top: "+=" + border }, 1000);
$(el + " > div:gt(0)").css("border-top", "1px solid #ccc");
It works perfectly in Firefox... In Safari, the div itself moves down but the table within the div doesn't move with it. Also, the table will "pop in place" when I click a text box. Weird... Anyone wanna take a guess as to what's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论