javascript - 试图创建一个下拉菜单,但它不适用于 javascript

标签 javascript jquery html css

This is what it looks like when cliked on

enter image description here

This is the expectation when clicked on what i used to display this is the :hover event but i want it clickable enter image description here

如果有任何可能,请尽快帮助修复 Javascript 编码

var content = document.getElementById("settingsBar");
var button = document.getElementById("show-more");

button.onclick = function() {
  if (content.className == "drop") {
    content.className = "";
  } else {
    content.className = "drop";
  }
};
#settingsBar {
  width: 100%;
  position: fixed;
  z-index: 1;
  background-color: #000;
  max-height: 56px;
  overflow: hidden;
  -webkit-transition: all 0.7s;
  -moz-transition: all 0.7s;
  transition: all 0.7s;
}
#settingsBar.drop {
  max-height: 1000px;
  color: #fff;
  -webkit-transition: all 0.7s;
  -moz-transition: all 0.7s;
  transition: all 0.7s;
}
#show-more i {
  padding-left: 48%;
  padding-top: 15px;
  color: #fff;
  -webkit-transition: color 0.7s;
  -moz-transition: color 0.7s;
  transition: color 0.7s;
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div id="settingsBar">
  <a href="#" id="show-more"><i class="material-icons large">settings</i></a>
  <br/>
  <iframe src="http://www.pigigram.com/account_settings.php" scrolling="no" frameborder="0" width="100%"></iframe>
</div>

Basicly What i want is to have it open the content to display the iframe and allow them to use the settings

最佳答案

button.onclick = fucntion(); {

你拼错了函数这个词

关于javascript - 试图创建一个下拉菜单,但它不适用于 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35096785/

相关文章:

javascript - Javascript Module Pattern 可以用于单例,也可以用于实例化多次的对象吗?

使用 google chrome 时出现 jquery xml 问题

javascript - 如何从异步调用返回响应?

css - 删除垂直空间 html

html - CSS float 逻辑

javascript - https post 在 javascript 中类似于带有 header 和参数的curl -d 和 "request"模块nodejs npm

javascript - 如何在 Vue.js 类绑定(bind)上检查当前元素的属性?

javascript - 如何使用 HTML DOM 在 TEXT_NODE 之前插入图像

javascript - 找到并选择正确的类(class)

java - 用于短语和区分大小写搜索的 HTML 解析器,使用 Java