li前的小圖標居中對齊 獲取滾動條的高度

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="utf-8" />
<meta name="robots" content="all" />
<meta name="author" content="Tencent-ISRD" />
<meta name="Copyright" content="Tencent" />
<script type="text/javascript" src="jquery-1.8.1.js"></script>
<style type="text/css" media="screen">
ul li{
    list-style-type:none;
    padding-left:15px;
    background: url(file:///C|/Users/huinawang/Desktop/1.png) no-repeat 4px 12px;
    line-height:30px;
    }

</style>
<title>column-rule-style</title>
</head>
<body>

            <div class="hideNav-fixed-top">
                <ul>
                    <li><a href="#">很多</a></li>
                    <li><a href="#">很多</a></li>
                    <li><a href="#">很多</a></li>
                    <li><a href="#">很多</a></li>
                    <li><a href="#">很多</a></li>
                </ul>
            </div>
            <div style="height:1000px"></div>

</body>
<script type="text/javascript">
$(document).ready(function(){
    $(window).scroll(function(){
        var scrollTop=$(window).scrollTop();
        console.log(scrollTop);
        if(scrollTop>100){
            $(".hideNav-fixed-top").css("display","block");
            }else{
                $(".hideNav-fixed-top").css("display","none");
                }
        })
    })
</script>
</html>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章