彈出層與滾動條控件

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/css/style.css">
<script src="/js/jquery-1.11.0.min.js" type="text/javascript"></script>


</head>

<body>
<div class="shei" style="width:100%;height:100%;position:absolute;!important;top:0; z-index:1000;display:none; background-color:rgba(0,0,0,0.3);">
<img width="300" height="300" style="position: absolute;top:600px;left:40%" src="/images/index_23.png"></div>

<a href="javascript:;" class="weixin">微信平臺</a>

</body>

</html>



<script type="text/javascript">
$(function(){
    $(".weixin").click(function(){
        $(".shei").css("height",$(document).height()); //獲取瀏覽器高度
         jQuery(window).scroll(function(){
                jQuery(window).scrollTop(500); //設置滾動條固定
        });
         $(".shei").show();    
    });

    $(".shei").click(function(){
        $(window).unbind('scroll'); //清楚滾動條固定
        $(".shei").hide();
    });

});

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