Drop Down Menu Click

99封情书 提交于 2019-12-11 15:16:11

问题


Should be an easy question...

My NAV Bar Template (working): https://codepen.io/ScottFSchmidt/pen/GMzgKz

...imported into my Portfolio (is NOT working): https://scottschmidtportfolio.000webhostapp.com/#
The menu is not going down on click(the menu appears when the screen is smaller).

What is causing this? I have a feeling it is something within my scripts (below): EDIT NEW UPDATED SCRIPTS from https://www.bootstrapcdn.com/:

 <!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">

<title>SS Studio</title>
<meta charset = "UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css"></script>
<script src="https://use.fontawesome.com/fab417e5fd.js"></script>

<script language="javascript">

回答1:


Check the console:

Make sure Bootstrap loaded correctly. It look like you are trying to add bootstrap in three places.

Better to use CDNetworks. Here is the link for bootstrap cdn

Also you had one script error:

 $(window).scroll(function() {
       if ($(document).scrollTop() > 50) {
           $('nav').addClass('shrink');
       } else {
         $('nav').removeClass('shrink');
       }
   });
 // }); // remove this

Caution:

You're using HTTPS but some resources are requested in an insecure way. use https:// for including all the resources like images, css, js, etc



来源:https://stackoverflow.com/questions/46994625/drop-down-menu-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!