jQuery 尝试内联显示元素会出现错误
我正在尝试显示一个 html 元素,但它必须具有 inline 属性。我的代码中的第二行破坏了 html 页面:
$('#add_existing_suggestion').fadeIn(100).show();
$('#add_existing_suggestion').css("display":"inline");
我在这个论坛上看到它对人们有用: http ://forum.jquery.com/topic/fadein-inline
有什么方法可以使元素内联显示吗?
谢谢!!
I am trying to display an html element, but it has to have the inline attribute. The second line in my code breaks the html page:
$('#add_existing_suggestion').fadeIn(100).show();
$('#add_existing_suggestion').css("display":"inline");
I saw on this forum that it worked for people: http://forum.jquery.com/topic/fadein-inline
Any way I can make the element get displayed inline?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
css
方法采用两个参数作为字符串或包含样式键/值对的映射。你所做的将会在页面上给出语法错误,并且也会破坏其他js。试试这个css
method take two arguments as string or a map containing key/value pair of styles. What you are doing will give a syntax error on the page and will break other js also. Try this你的语法不正确。 .css() 的语法是:
将其更改为
$('#add_existing_suggestion').css("display", "inline");
Your syntax is incorrect. The syntax for .css() is:
Change it to
$('#add_existing_suggestion').css("display", "inline");