如何使用了slideDown(或显示)功能在表行? [英] How to Use slideDown (or show) function on a table row?

查看:153
本文介绍了如何使用了slideDown(或显示)功能在表行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想行添加到表,并有该行陷入看法,但是功能了slideDown似乎是添加显示:块样式到弄乱布局表行

任何想法如何解决此问题?

这里的code:

  $。获得('/ SOME_URL',
  {'VAL1':ID},  功能(数据){
    VAR行= $('#detailed_edit_row');
    row.hide();
    row.html(数据);
    row.slideDown(1000);
  }
);


解决方案

动画不支持表行。

从学习jQuery的由Chaffer和斯威德伯格



  

表行present特别
  障碍动画,因为浏览器
  使用不同的值(表的行和
  块)为他们的可见显示
  属性。所述.hide()和.show()
  方法,没有动画,总是
  安全与表行使用。作为
  jQuery的版本1.1.3,.fadeIn()和
  .fadeOut()可以使用为好。



您可以在一个div包住TD的内容,并使用了slideDown上。你需要决定是否动画是值得额外的标记。

I'm trying to add a row to a table and have that row slide into view, however the slidedown function seems to be adding a display:block style to the table row which messes up the layout.

Any ideas how to work around this?

Here's the code:

$.get('/some_url', 
  { 'val1': id },

  function (data) {
    var row = $('#detailed_edit_row');
    row.hide();
    row.html(data);
    row.slideDown(1000);
  }
);

解决方案

Animations are not supported on table rows.

From "Learning jQuery" by Chaffer and Swedberg


Table rows present particular obstacles to animation, since browsers use different values (table-row and block) for their visible display property. The .hide() and .show() methods, without animation, are always safe to use with table rows. As of jQuery version 1.1.3, .fadeIn() and .fadeOut() can be used as well.


You can wrap your td contents in a div and use the slideDown on that. You need to decide if the animation is worth the extra markup.

这篇关于如何使用了slideDown(或显示)功能在表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆