Khi một div được nhấp, tôi muốn div khác xuất hiện.Hiển thị div #id khi nhấp chuột với jQuery
Do đó, khi '#music' được nhấp, tôi muốn '#musicinfo' xuất hiện.
Đây là css:
#music {
float:left;
height:25px;
margin-left:25px;
margin-top:25px;
margin-right:80px;
font-family: "p22-underground",sans-serif;
font-style: normal;
font-weight: 500;
font-size:13pt;
}
#musicinfo {
width:380px;
margin:25px;
font-family: "p22-underground",sans-serif;
font-style: normal;
font-weight: 500;
font-size:13pt;
line-height:1.1;
display:none;
}
và jquery:
<script type="text/javascript">
$("#music").click(function() {
$("#musicinfo").show("slow");
});
</script>
Bất kỳ sự giúp đỡ nào sẽ là tuyệt vời :)
Và nếu bạn quấn đó vào một '$ (document) .ready()' phương pháp, thì nó sẽ hoạt động. Bạn đang gặp phải vấn đề gì? –