我正在看这个模板html文件(如下)。当我从第168到第195行注释掉div时,导航栏停止变粘。在这上花了一个多小时,我看到当我评论该部分时,$(document).ready函数不再触发。所有网络搜索只是说可能没有正确包含jquery但是文件似乎被调用,因为当我开始时我可以在jquery文件的开头触发断点。 任何帮助弄清楚为什么会发生这种情况会非常有帮助。整个文件结构位于this location
文件是:
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Flatfy Free Flat and Responsive HTML5 Template ">
<meta name="author" content="">
<title>Flatfy – Free Flat and Responsive HTML5 Template</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom Google Web Font -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700' rel='stylesheet' type='text/css'>
<!-- Custom CSS-->
<link href="css/general.css" rel="stylesheet">
<!-- Owl-Carousel -->
<link href="css/custom.css" rel="stylesheet">
<link href="css/owl.carousel.css" rel="stylesheet">
<link href="css/owl.theme.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<!-- Magnific Popup core CSS file -->
<link rel="stylesheet" href="css/magnific-popup.css">
<script src="js/modernizr-2.8.3.min.js"></script> <!-- Modernizr /-->
<!--[if IE 9]>
<script src="js/PIE_IE9.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="js/PIE_IE678.js"></script>
<![endif]-->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
</head>
<body id="home">
<!-- Preloader -->
<div id="preloader">
<div id="status"></div>
</div>
<!-- FullScreen -->
<div class="intro-header">
<div class="col-xs-12 text-center abcen1">
<h1 class="h1_home wow fadeIn" data-wow-delay="0.4s">Flatfy</h1>
<h3 class="h3_home wow fadeIn" data-wow-delay="0.6s">Clean & minimal Theme</h3>
<ul class="list-inline intro-social-buttons">
<li><a href="https://twitter.com/galantiandrea" class="btn btn-lg mybutton_cyano wow fadeIn" data-wow-delay="0.8s"><span class="network-name">Twitter</span></a>
</li>
<li id="download" ><a href="#downloadlink" class="btn btn-lg mybutton_standard wow swing wow fadeIn" data-wow-delay="1.2s"><span class="network-name">Free Download</span></a>
</li>
</ul>
</div>
<!-- /.container -->
<div class="col-xs-12 text-center abcen wow fadeIn">
<div class="button_down ">
<a class="imgcircle wow bounceInUp" data-wow-duration="1.5s" href="#whatis"> <img class="img_scroll" src="img/icon/circle.png" alt=""> </a>
</div>
</div>
</div>
<!-- NavBar-->
<nav class="navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#home">Flatfy</a>
</div>
<div class="collapse navbar-collapse navbar-right navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li class="menuItem"><a href="#whatis">What is?</a></li>
<li class="menuItem"><a href="#useit">Use It</a></li>
<li class="menuItem"><a href="#screen">Screenshot</a></li>
<li class="menuItem"><a href="#credits">Credits</a></li>
<li class="menuItem"><a href="#contact">Contact</a></li>
</ul>
</div>
</div>
</nav>
<!-- What is -->
<div id="whatis" class="content-section-b" style="border-top: 0">
<div class="container">
<div class="col-md-6 col-md-offset-3 text-center wrap_title">
<h2>What is?</h2>
<p class="lead" style="margin-top:0">A special thanks to Death.</p>
</div>
<div class="row">
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/tweet.svg" alt="Generic placeholder image">
<h3>Follow Me</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/picture.svg" alt="Generic placeholder image">
<h3>Gallery</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/retina.svg" alt="Generic placeholder image">
<h3>Retina</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
<div class="row tworow">
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/laptop.svg" alt="Generic placeholder image">
<h3>Responsive</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/map.svg" alt="Generic placeholder image">
<h3>Google</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
<div class="col-sm-4 wow fadeInDown text-center">
<img class="rotate" src="img/icon/browser.svg" alt="Generic placeholder image">
<h3>Bootstrap</h3>
<p class="lead">Epsum factorial non deposit quid pro quo hic escorol. Olypian quarrels et gorilla congolium sic ad nauseum. </p>
<!-- <p><a class="btn btn-embossed btn-primary view" role="button">View Details</a></p> -->
</div><!-- /.col-lg-4 -->
</div><!-- /.row -->
</div>
</div>
<div class="content-section-c ">
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3 text-center white">
<h2>Get Live Updates</h2>
<p class="lead" style="margin-top:0">A special thanks to Death.</p>
</div>
<div class="col-md-6 col-md-offset-3 text-center">
<div class="mockup-content">
<div class="morph-button wow pulse morph-button-inflow morph-button-inflow-1">
<button type="button "><span>Subscribe to our Newsletter</span></button>
<div class="morph-content">
<div>
<div class="content-style-form content-style-form-4 ">
<h2 class="morph-clone">Subscribe to our Newsletter</h2>
<form>
<p><label>Your Email Address</label><input type="text"/></p>
<p><button>Subscribe me</button></p>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- JavaScript -->
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/owl.carousel.js"></script>
<script src="js/script.js"></script>
<!-- StikyMenu -->
<script src="js/stickUp.min.js"></script>
<script type="text/javascript">
jQuery(function($) {
$(document).ready( function() {
$('.navbar-default').stickUp();
});
});
</script>
<!-- Smoothscroll -->
<script type="text/javascript" src="js/jquery.corner.js"></script>
<script src="js/wow.min.js"></script>
<script>
new WOW().init();
</script>
<script src="js/classie.js"></script>
<script src="js/uiMorphingButton_inflow.js"></script>
<!-- Magnific Popup core JS file -->
<script src="js/jquery.magnific-popup.js"></script>
</body>
</html>
答案 0 :(得分:0)
我终于弄清楚出了什么问题。因为我从文件中删除了所有变形元素,所以uiMorphingButton_inflow.js抛出此错误并阻止其他事件发生。一旦我删除了对此文件的引用。它工作正常!