我有一个页面上有许多面板,每个面板都显示为缩略图。缩略图的数据是从数据库中提取的,所以基本上代码如下:
while ($courant = $sth->fetch()) {
echo '<div class="panel panel-default inline" big=".$courant->big.">
<div class=panel-body>
<a class="box" href="something"><img src="some other thing"/>
</a>
</div>
</div>';
}
主div中的big
属性为0或1.如何在复选框上使用JavaScript / jQuery显示/隐藏具有big=0
的div块?我知道有一个hide()
函数,但我认为它只适用于类和ID。