我剛纔剛剛介紹給HTML代碼3天前,並沒有學到太多,這可能是一個簡單的修復,但標題說這一切。我不確定如何設置頁面鏈接,因此我可以使用平滑滾動的jQuery插件localscoll.js。噢和IM試圖鏈接.section2到.arrow和servers.pnglocalscroll.js - 似乎無法弄清楚如何設置鏈接
的Javascript:
<script type="text/javascript">
jQuery(function($){
$.localScroll.defaults.axis = 'xy';
$.localScroll({
target: '#content',
queue:true,
duration:1000,
hash:true,
onBefore:function(e, anchor, $target){
},
onAfter:function(anchor, settings){
}
});
});
</script>
HTML:
<div class="section1">
<div class="menubar">
<div class="menubar fadeInUp animated">
<a href="#section2"><img class="menutext" src="images/menu_bar/servers.png"> </a>
</div>
<div class="banner wow fadeInUp animated" data-wow-delay="0.75s" />
<a href="#section2"><img class="arrow wow fadeIn animated" data-wow-delay="0.75s" src="css/banner/arrow.png"></a>
</div>
</div>
<div class="section2">
<a name="section2"></a>
</div>
</div>
CSS:
.arrow {
margin-top: 470px;
text-align: center;
}
.section2 {
background: url(section2/background.png);
background-position: center;
width: 100%;
height: 515px;
margin-bottom: 0;
position: relative;
}
也許你可以發佈工作的jsfiddle或JSBin? –