0

假设我有这样的 html

<span class='hide'>
   nothing to comment please be good to each other
</span>

风格

.hide{
   /*visibility:hidden;*/
   display:none;
   width:100px;
   height:auto;
}

如果我使用 css,例如display:none or visibility:hidden隐藏所有(布局和文本),我想保留文本并仅隐藏布局。有没有办法存档这个案例?衷心感谢您的热心帮助...

4

1 回答 1

-2

Just use toggleClass and create one class that is bare, and one class with all the layout you want

<span class='hide' id='comment'>
   nothing to comment please be good to each other
</span>


$("#comment").toggleClass("oldClass newClass");

.oldClass {
  <!--bare formatting-->
}

.newClass{
  <!--fancy formatting-->
}
于 2013-04-26T04:51:00.190 回答