隐藏 3 列并将其中一列扩展为 100% 行时的 jQuery 过渡效果
jQuery transition effect when hiding 3 columns and expanding one to be 100% of row
我的页面最初有 4 个包装器div,每个包装器div 都有一个"col-md-3"
类,但在单击展开按钮后,其中 3 个包装器被隐藏,点击的包装器得到"col-md-12":
// If wrapper is the current wrapper expand to col-md-12 otherwise hide
$(".wrapper").each(function (index) {
if ($(this).attr("id") === wrapper.attr("id")) {
$(this).removeClass("col-md-3").addClass("col-md-12");
} else {
$(this).hide();
}
});
有没有快速/简单的方法来制作这样的动画?我不喜欢将jQuery UI库添加到我的项目中。我更喜欢从左到右的滑动运动。
到目前为止,我唯一能想到的就是做:
$(this).hide('1000');
但是,我更喜欢在添加类"col-md-12"时制作动画,而不是隐藏其他类。
我更喜欢从左到右的滑动运动。
在 JQuery 中,您可以使用
$(this).stop().animate({
right: '-50%' //distance of moving
}, 400); //time of moving in ms
相关文章:
- Node.js v6.2.0类扩展不是函数错误
- 扩展移相器按钮类不工作
- chrome扩展中的navigator.geolocation.getCurrentPosition
- chrome扩展:尽管运行了at:documentidle,js脚本还是过早启动
- chrome扩展更改主机/域警告
- TableExport jquery插件:文件名和扩展名问题
- 如何在chrome扩展中重定向到html页面
- Chrome扩展没有't在重新加载之前考虑期权价值
- 扩展SVGTextElement时出现Typescript Uncaught TypeError
- 如何通过自己获得Chrome扩展的用户反馈/错误报告
- Javascript”;类“;带有参数的扩展
- 试图阻止Chrome通过扩展关闭
- 如何在chrome扩展中存储数据/结果,以及如何使用setTimeout使其只被调用一次
- 表达式引擎扩展开发-向呈现的条目添加自定义javascript
- 从选项页面更新chrome扩展清单权限
- 如何将chrome扩展功能移植到移动设备(特别是jquery和trello)
- 表不会扩展到 100%
- 隐藏 3 列并将其中一列扩展为 100% 行时的 jQuery 过渡效果
- 将图像的宽度扩展到父级之外 100%
- Img在点击时扩展到100%(并且仍然停留在网格上)