使用脚本在另一个div中显示子菜单
我正在使用javascript在页面中的自定义位置显示子菜单
- 错误是它不显示子菜单
- 我使用设计的表单在dis123 div标签中显示它
- 当我只尝试脚本代码时,它的工作原理
- 当我尝试设计页面时,它不起作用
这是完整的代码
码
Blueprint: Vertical Icon Menu body {position: relative;font-family: 'Lato', Calibri, Arial, sans-serif; color: #47a3da;} body, html { font-size: 100%; height: 100%; padding: 0; margin: 0;} a {color:#f0f0f0;text-decoration: none;} a:hover {color: #000;} #header{height: 90px;width: 100%;background-color: #B9F5BB;} #footer{height: 50px;width: 100%;background-color: #FDD5CB;} .dis123{width:75%;float:left; height: 500px;background-color:#DCEEE3; text-align: left; } .postleftmen{width:25%;float:left;} Head function mob() { first(); document.getElementById('mobi').style.display = "block"; } function ele() { first(); document.getElementById('elec').style.display = "block"; } function veh() { first(); document.getElementById('vehi').style.display = "block"; } function hme() { first(); document.getElementById('home').style.display = "block"; } function pet() { first(); document.getElementById('pets').style.display = "block"; } function boo() { first(); document.getElementById('book').style.display = "block"; } function first(){ document.getElementById('mobi').style.display = "none"; document.getElementById('elec').style.display = "none"; document.getElementById('vehi').style.display = "none"; document.getElementById('home').style.display = "none"; document.getElementById('pets').style.display = "none"; document.getElementById('book').style.display = "none"; }
上面是显示HTML,CSS,SCRIPT页面的完整代码
任何人都可以帮助什么是错的
我需要在里面显示以下内容
这是你的例子的小提琴
首先
onclick="mob()"
我建议这个
onclick="mob();"
并将你的脚本放在头上然后调用它