0
Im实现侧边菜单到帮助页面。带内部链接的bootstrap侧面菜单跳转点击
菜单和内部链接正在工作,但点击旁边的菜单会在导航栏后部分跳转。
我不知道如何解决这个问题,作为一个新手和所有。
有人能告诉我请
这里是html
<div class="container-fluid info-pages">
<div class="col-md-3 col-xs-12" id="leftCol">
<h5>HELP</h5>
<ul class="help nav nav-tabs nav-stacked" id="sidebar">
<li><a href="#Customer_Service">Customer Service</a></li>
<li><a href="#Shipping&delivery">Shipping & Delivery</a></li>
<li><a href="#ReturnPolicy">Return Policy/Exchanges</a></li>
<li><a href="#stockist">Stockist/Brand Inquiries</a></li>
<li><a href="#webissues">Web Issues</a></li>
<li><a href="#faq">FAQ</a></li>
</ul>
</div>
<div class="col-md-6 col-xs-12" id="mainCol">
<h5 id="Customer_Service">CUSTOMER SERVICE</h5>
<div class="col-md-6 col-xs-12">
<ul class="customer-service">
<li>Call: +555-5555555</li>
<li>Email: [email protected]</li>
</ul>
</div>
<div class="col-md-6 col-xs-12">
<ul class="customer-service">
<li>Monday—Friday</li>
<li>11:00—18:00 GMT</li>
<li>Saturday</li>
<li>11:00 - 18:00 GMT</li>
<li>Sunday</li>
<li>Closed</li>
</ul>
</div>
<br>
<h5 id="Shipping&delivery">SHIPPING & DELIVERY</h5>
<p> Chartreuse master cleanse succulents, chicharrones kombucha chambray DIY green juice marfa roof party fanny pack lo-fi live-edge godard pork belly. Enamel pin venmo raclette occupy chartreuse plaid. Offal raclette live-edge venmo kale chips, humblebrag man braid hammock cliche quinoa meh mumblecore. Blue bottle gentrify butcher pop-up subway tile, food truck XOXO bitters af. Hot chicken bitters knausgaard four dollar toast, truffaut tousled etsy cray iceland cold-pressed pabst single-origin coffee poutine crucifix. Pitchfork artisan crucifix, sriracha cray four loko chillwave. Next level iceland craft beer, kale chips occupy bushwick chambray schlitz hashtag hammock locavore poke squid.
</p>
<br>
<h5 id="ReturnPolicy">RETURN POLICY/EXCHANGES</h5>
<p>Chartreuse master cleanse succulents, chicharrones kombucha chambray DIY green juice marfa roof party fanny pack lo-fi live-edge godard pork belly. Enamel pin venmo raclette occupy chartreuse plaid. Offal raclette live-edge venmo kale chips, humblebrag man braid hammock cliche quinoa meh mumblecore. Blue bottle gentrify butcher pop-up subway tile, food truck XOXO bitters af. Hot chicken bitters knausgaard four dollar toast, truffaut tousled etsy cray iceland cold-pressed pabst single-origin coffee poutine crucifix. Pitchfork artisan crucifix, sriracha cray four loko chillwave. Next level iceland craft beer, kale chips occupy bushwick chambray schlitz hashtag hammock locavore poke squid.
</p>
<br>
<h5 id="stockist">STOCKIST/BRAND INQUIRIES</h5>
<p>Chartreuse master cleanse succulents, chicharrones kombucha chambray DIY green juice marfa roof party fanny pack lo-fi live-edge godard pork belly. Enamel pin venmo raclette occupy chartreuse plaid. Offal raclette live-edge venmo kale chips, humblebrag man braid hammock cliche quinoa meh mumblecore. Blue bottle gentrify butcher pop-up subway tile, food truck XOXO bitters af. Hot chicken bitters knausgaard four dollar toast, truffaut tousled etsy cray iceland cold-pressed pabst single-origin coffee poutine crucifix. Pitchfork artisan crucifix, sriracha cray four loko chillwave. Next level iceland craft beer, kale chips occupy bushwick chambray schlitz hashtag hammock locavore poke squid.
</p>
<br>
<h5 id="webissues">WEB ISSUES</h5>
<p>Chartreuse master cleanse succulents, chicharrones kombucha chambray DIY green juice marfa roof party fanny pack lo-fi live-edge godard pork belly. Enamel pin venmo raclette occupy chartreuse plaid. Offal raclette live-edge venmo kale chips, humblebrag man braid hammock cliche quinoa meh mumblecore. Blue bottle gentrify butcher pop-up subway tile, food truck XOXO bitters af. Hot chicken bitters knausgaard four dollar toast, truffaut tousled etsy cray iceland cold-pressed pabst single-origin coffee poutine crucifix. Pitchfork artisan crucifix, sriracha cray four loko chillwave. Next level iceland craft beer, kale chips occupy bushwick chambray schlitz hashtag hammock locavore poke squid.</p>
</div>
这里是javascript
<script type="text/javascript">
var $body = $(document.body);
var navHeight = $('.navbar').outerHeight(true) + 10;
$('#sidebar').affix({
offset: {
top: 245,
bottom: navHeight
}
});
$body.scrollspy({
target: '#leftCol',
offset: navHeight
});
</script>
这里是.css
/*######## HELP PAGE ########## */
.info-pages{
margin-bottom: 20vw;
margin-top: 10vh;
padding-top:50px;
}
.info-pages p,li {
font-size: .9em;
}
.help{
list-style: none;
}
.customer-service {
list-style: none;
}
@media screen and (min-width: 768px) {
#masthead h1 {
font-size: 100px;
}
}
.affix-top,.affix{
position: static;
}
@media (min-width: 979px) {
#sidebar.affix-top {
position: static;
margin-top:30px;
width:228px;
}
#sidebar.affix-bottom {
position: relative;
}
#sidebar.affix {
position: fixed;
top:70px;
width:228px;
}
}
以及它没有任何区别:( – Slowboy
有人跳点击之前,我插入上面的代码,请参考这个网址https://jsfiddle.net/yvkkg9d1 /?utm_source = website&utm_medium = embed&utm_campaign = yvkkg9d1 – dev254
是的,这是正确的...但主要文本并没有移动...例如,如果你点击F&Q主文本不去F&A – Slowboy