如何在 .animate 上添加输入宽度
我想在 .animate({width: "auto"}, 'slow');
上设置 width auto,但这不起作用? 如果有人可以提供帮助,我将非常感激。
小提琴:
http://jsfiddle.net/DCjYA/327/
谢谢你 !
I want to set width auto on .animate({width: "auto"}, 'slow');
, but this is not working?
If someone can help I'll really appreciate.
fiddle:
http://jsfiddle.net/DCjYA/327/
Thank you !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:
在模糊上添加了一个动态元素(按钮)来计算宽度并立即删除。所以您不需要更改 html 中的任何内容。
DEMO
我添加了一个隐藏的跨度,然后在span 来计算跨度的宽度。然后获取跨度的外部宽度并将其应用于模糊的文本框。
演示
Edit:
Added a dynamic element (button) on blur to calculate the width and removed right away.. So you don't need to change anything in html.
DEMO
I added a hidden span, and then added the textbox content inside the span to calculate the width of the span. Then got the outerWidth of the span and applied it to textbox on blur.
DEMO
这是有效的及其简单的 DEMO
This works and its simple DEMO