1 回答
TA贡献1852条经验 获得超1个赞
我没有看到三角形,但你必须给出尺寸属性才能div看到,我猜你错过了。
function triangleChange1() {
var x = document.getElementById("triangle1")
var y = document.getElementById("bID")
if (y.style.display === "none") {
x.style.transform = "rotate(90deg)";
y.style.display = "block";
} else {
x.style.transform = "rotate(-90deg)";
y.style.display = "none";
}
}
.triangle1
/*, .triangle2, .triangle3, .triangle4, .triangle5*/
{
width: 30px;
height: 30px;
border-top: 6px solid transparent;
border-left: 14px solid #555;
border-bottom: 6px solid transparent;
margin-left: 25px;
cursor: pointer;
transition: 0.5s;
border: 1px solid red;
background: teal;
}
<div class="triangle1" id="triangle1" onclick="triangleChange1()"></div>
<div class="balance" onclick="triangleChange1()"> Student Card Balance </div><br>
<div class="bID" id="bID"> $
<?php echo $Balance;?> </div><br>
- 1 回答
- 0 关注
- 90 浏览
添加回答
举报