html 灰度

參考文章:http://www.cnblogs.com/lostyu/p/3528785.html
寫一下我的操作步驟:
1.下載【grayscale.js】
2.在html 的head裏,加入

<script src="js/jquery_1.8.1.js"></script>
<script src="js/grayscale.js"></script>
<script>
    window.onload = function(){
        $("body").css({
            "grayscale(1)": "grayscale(1)",
            "-webkit-filter": "grayscale(1)"
        });
        var el = document.getElementById( 'body' );
        grayscale( el );
    };
</script>

完成

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