- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
所以基本上我正在处理一个可以用漂亮的动画处理其行的表格。问题是我无法将行缩小到超出其大小小于其内容大小的位置。一旦收缩动画达到文本的高度(我正在垂直收缩),它就会停止。当然,我也在 Google 和 Stack Overflow 上寻找答案,并找到了很多,但我尝试了所有这些都没有成功。我尝试在 CSS 中编写 overflow: hidden;
,以及所有其他声称可以解决此问题的内容。
Here是我的工作示例(很抱歉没有在这里显示代码,但是链接一个工作和可编辑的示例会更容易)。单击按钮创建一个新表,然后单击行以使其消失。
我知道这个问题以前在其他地方已经回答过,但这些解决方案似乎对我不起作用。
有什么想法吗?我希望被点击的行在被删除之前完全缩小。
PS.:对不起,如果我是愚蠢的,我是网络开发的新手。
PS2.:请不要使用 jQuery。
最佳答案
你必须像这样更新/改变行高
https://jsfiddle.net/9hznp00s/12/
function deleteRow(id) {
if (typeof (id) === 'undefined') return;
var element = document.getElementById(id);
// Set the row's height and opacity to 0 (the changes are animated by the CSS)
// I commented this out so it's easier to see the collapse effect
//element.style.opacity = 0;
element.style.height = '0px';
element.style.maxHeight = '0px';
element.style.lineHeight = '0px';
element.style.opacity=0.0;
// After the animation is done, remove the row form the HTML
setTimeout(function () {
element.innerHTML = '';
element.parentNode.removeChild(element);
}, 500);
}
或尝试其中之一
https://jsfiddle.net/9hznp00s/8/
function deleteRow(id) {
if (typeof (id) === 'undefined') return;
var element = document.getElementById(id);
// Set the row's height and opacity to 0 (the changes are animated by the CSS)
// I commented this out so it's easier to see the collapse effect
//element.style.opacity = 0;
element.style.height = '0px';
element.style.maxHeight = '0px';
element.style.fontSize = '0px';
// After the animation is done, remove the row form the HTML
setTimeout(function () {
element.innerHTML = '';
element.parentNode.removeChild(element);
}, 500);
}
https://jsfiddle.net/9hznp00s/10/
function deleteRow(id) {
if (typeof (id) === 'undefined') return;
var element = document.getElementById(id);
// Set the row's height and opacity to 0 (the changes are animated by the CSS)
// I commented this out so it's easier to see the collapse effect
//element.style.opacity = 0;
element.style.height = '0px';
element.style.maxHeight = '0px';
element.style.fontSize = '0px';
element.style.opacity=0.0;
// After the animation is done, remove the row form the HTML
setTimeout(function () {
element.innerHTML = '';
element.parentNode.removeChild(element);
}, 500);
}
关于javascript - 调整 <tr> 大小时无法让溢出工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29263453/
我想要数组中所选 tr 的所有下一个 tr 的 data-id。我使用此代码,但这不是一个好代码。 var ids = Array.prototype.slice.call($("tr.selecte
JSFiddle:http://jsfiddle.net/9u8tnh97/ 我正在使用 jQuery 和 Bootstrap。我有一张 table 4 像这样的元素:
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
在 Notepad++ 中,我试图制作一个正则表达式来匹配标签。起初,我认为必须转义大括号,所以我尝试了 \ .然而,这不仅符合我预期的开始标签,而且匹配所有 。 s( 和 )。这是为什么? 最佳答
我正在尝试定位其中包含子表行元素的表中的最后一个父表行。我已尝试使用下面的 jQuery 来定位 :last 伪值,但是,如预期的那样,它的目标是目标父表中的绝对最后一个表行元素。 $('table[
我想插入新的在每个现有的 之后。我的功能: var element = document.querySelector('tr.cart-item'); var newElement = docume
这个问题在这里已经有了答案: RegEx match open tags except XHTML self-contained tags (35 个答案) 关闭 9 年前。 我希望这个正则表达式匹
生成此代码是为了做两件事。第一个是单击复选框时突出显示表记录。第二个是即使页面刷新也能记住结果。 Untitled Document
嗨,我正在尝试在 tr 数组中查找 tr属性名称是 docId 是否有任何类型的 jquery 选择器? 我不想只用 for 循环遍历数组然后自己去找。 除非你说我别无选择... 谢谢 最佳答案 如果
我有一张 table ,我想在单击加号图标时在 tr 中打开相同的 tr。我不明白我使用哪个 html 元素打开。 请帮帮我。提前致谢。
对你来说是个小问题:-) 我正在使用 BeautifulSoup 来解析 HTML 页面中表格的内容。问题是在我的输出文件的每一行(CSV/EXCEL)之间,它拉出一个空行......这是 HTML
我制作了一个包含基本信息的表格,每个奇数行和偶数行都有不同的颜色。在 :hover影响它是橙色的,不管它是偶数还是奇数。 但是当我想“分组”3 我发现了一个问题。我试着把它包装成 但它没有用。我的目标
在 lxml 中,我使用 xpath 选择表(具有不同行数)中的所有 tr,除了包含乱码的最后两行。 是否有排除最后两行的模式匹配?我正在浏览 xpath 教程,显然有一个“except”运算符和一个
我在表列表中显示来自数据库的记录。此外,我在每一行中都有一个跟进按钮,如果任何用户单击跟进按钮,则会为特定用户打开一个包含详细信息的弹出窗口。 或者任何其他想法来处理这个问题? 我试过用这样的东西
我有以下表格结构。 当我点击 时我想添加新的 在 旁边其中被点击。 所以结果会是:
使用这个 HTML: 1 2 3 4 我得到这个输出: 1 2 3 4 但我想要的是: 1 2 3 4 如何
嗨,我有一个表格,我在这里做了一些代码来将表格更改为可编辑和可选择...我的要求是 1.当点击一个TR时,它应该变成蓝色,再次点击另一个TR,它将显示蓝色,旧的TR变成白色(威胁不可选择) 我由于一些
这个问题可能令人困惑,但这就是确切的情况.. 我已经动态生成了一些(根据从数据库获取的数据),现在我想允许用户选择其中一个单选按钮,并且我想捕获所单击的行的详细信息,因此请检查我的代码并协助 我的aj
免责声明:HTML、JQuery、Ajax 技能水平 — 垃圾。一直是一个厚客户。 我有一个表单,允许用户输入客户代码和电子邮件地址。我想在客户代码有效时显示客户的姓名。我会错误地通过 Ajax 和
正在尝试添加 其他元素 表中的元素根据 的行跨度该特定元素 元素。在同一功能中,单击 中的此按钮后元素的行数每次增加1,因此也需要增加行数。不知道该怎么做。也许使用 slice()以某种方式发挥作
我是一名优秀的程序员,十分优秀!