【发布时间】:2012-08-06 20:00:08
【问题描述】:
我的模板上有一个加载的动态内容。默认的 div 背景颜色是黄色,但是当内容超过 300 像素时,div 会切换或附加将背景颜色更改为红色的类。下面是代码。
<!DOCTYPE html>
<head>
<title>Untitled Document</title>
<style type="text/css" media="all">
.short {background-color:yellow;padding:30px; width:200px;}
.long {background-color:red;padding:30px;width:200px;}
</style>
</head>
<body>
<div class="short">div content</div>
</body>
</html>
【问题讨论】:
-
您的动态内容是如何加载的?有没有什么地方可以挂钩,我们可以确定它是在内容完成动态加载之后?
标签: javascript jquery css toggle