javascript
html导航下拉菜单js点击显示不出来,使用JS做下拉菜单,子菜单不显示
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
}
#fa{
display: block;
width: 100px;
height: 30px;
line-height: 30px;
text-align: center;
background: green;
color: yellow;
}
#fa:hover{
background: orange;
color: black;
}
#son{
width: 100px;
list-style: none;
display: none;
}
ul a{
display: block;
width: 100px;
height: 30px;
background: #CCC;
line-height: 30px;
text-align: center;
border-bottom: 4px solid red;
color: green;
}
function in(){
var lo=document.getElementById('son');
if (lo.style.display==none)
{
lo.style.display='block';
}
else{
lo.style.display='none';
}
}
我是父目錄
- 我是子目錄
- 我是子目錄
- 我是子目錄
1、ul未使用定位不知道是否有關(guān);
2、js初學(xué),if的用法搞不懂對(duì)不對(duì)。
PS:0基礎(chǔ)在家自學(xué),不懂的沒人指導(dǎo),求指點(diǎn)!!!!
總結(jié)
以上是生活随笔為你收集整理的html导航下拉菜单js点击显示不出来,使用JS做下拉菜单,子菜单不显示的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html页面加文字横向滚动,js实现文字
- 下一篇: gradle idea java ssm