请问如何使用HTML加CCS实现下面这个功能呢
<script src="jquery-1.11.1.min.js"></script>
<div style="height:1900px;background:#FC0;margin-top:40px;position:relative;">
<ul id="napppv" class="yungf">
<li>导航栏项目一</li>
<li>导航栏项目二</li>
<li>导航栏项目三</li>
<li>导航栏项目四</li>
<li>导航栏项目五</li>
</ul>
</div>
<script>
$(function(){
var a = $('#napppv'),
b =a.offset();
$(document).on('scroll',function(){
var c = $(document).scrollTop();
if(b.top<=c){
a.css({'position':'fixed','top':'0px'})
}else{
a.css({'position':'absolute','top':'300px'})
}
})
})
</script>