簡體   English   中英

嘗試創建一個下拉菜單,但它不適用於JavaScript

[英]trying to create a dropdown menu but it is not working for the javascript

這就是他們穿上時的樣子

在此輸入圖像描述

這是期望當點擊我用來顯示這是:hover事件,但我希望它可點擊 在此輸入圖像描述

如果可以修復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> 

基本上我想要的是讓它打開內容以顯示iframe並允許他們使用設置

button.onclick = fucntion(); {

你拼錯了單詞功能

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM