,我已經使用了一段代碼被點擊一丸當滾動到頁面上的某一點。現在我試圖讓scrollspy工作,所以類避孕藥會從「積極」到「禁用」(我爲「已禁用」類特殊的CSS設置,但我有沒有運氣。任何想法改變?Twitter的引導scrollspy不與導航藥丸的工作,我用引導的導航丸作爲我的頂部導航欄中,平滑滾動
下面的代碼:
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="pantastic.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Questrial|Lobster|Open+Sans:300,400|Josefin+Sans:300,400' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.slideto.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('.toplogo').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('.firstscroll').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('.secondscroll').click(function(){
$("html, body").animate({ scrollTop: 500 }, 600);
return false;
});
$('.thirdscroll').click(function(){
$("html, body").animate({ scrollTop: 1450 }, 600);
return false;
});
$('.fourthscroll').click(function(){
$("html, body").animate({ scrollTop: 2740 }, 600);
return false;
});
});
</script>
</head>
<body data-spy="scroll" data-target=".nav nav-pills">
<div class="navbox">
<div class="container">
<div class="row">
<div class="span5">
<a href="#"><img class="toplogo" src="navlogo.png" alt="logo"/></a>
</div>
<div class="span10 offset5">
<div class="navbuttons">
<ul class="nav nav-pills custom">
<li class="active firstscroll">
<a href="#1">Home</a>
</li>
<li class="disabled secondscroll"><a href="#secondunit">What is Pantastic?</a></li>
<li class="disabled thirdscroll"><a href="#3">About Us</a></li>
<li class="disabled fourthscroll"><a href="#4">FAQ</a></li>
<li class="disabled"><a href="#modal" data-toggle="modal"><img src="Price_Button.png" alt="Order Now" onmouseover="this.src='Price_Buttonhover.png'" onmouseout="this.src='Price_Button.png'"/></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="herounit">
<div class="container">
<h1> Introducing Pantastic! </h1>
<div class="row">
<h4> Pantastic is the easiest way to bring your iPhone panoramas to life! Simply send us your panorama, and we will print, matte, and ship it right to your doorstep. </h4>
</div>
<div id="secondunit">
<div class="row">
<img src="pricetag2.png" alt="pricetag">
</div>
</div>
</div>
</div>
我scrollspy仍然不工作,但我已經將數據目標設置爲父級,並且所有內容都有可解析的目標 - 您是否介意將代碼發佈到某處? –
@JessicaYang您可以在這裏查看我的代碼:http://thomaskbird.diverseevolution.com/resume其仍在建設中,但你可以看到滾動間諜的工作與我的代碼特定的div –