我的代码如下:
$(function(){
$("#ani").slideUp(600,function(){
$(this).text('13').slideDown(600);
});
})
HTML代码如下:
<div>Comment: <span id="ani">12</span></div>
页面加载后,幻灯片将影响Comment:
文本。 I have written this code in jsFiddle and you can watch it there.
问题是什么。我为外部 div 编写了 display
和 height
css 属性,但没有成功;(
最佳答案
像下面这样的东西应该可以做到。
div 应具有标准宽度,内部跨度为 float: right
<div>Comment:
<span id="ani">12</span>
</div>
CSS
div{width:100px;}
span{float:right;}
希望这有帮助
编辑
此更新基于OP的答案:
<div><span>Comment:</span>
<span id="ani">12</span>
</div>
CSS
span{float:left;display:inline-block;min-height:30px;}
关于jquery - SlideUp 和 SlideDown 会导致 Firefox 12 中的文本跳转吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11490009/