如何实现网页换肤效果

一个新手
一个新手 原创
2017-09-27 09:45:26 2253浏览


网页换肤效果

简单的换肤
蓝 红 绿

<!DOCTYPE html><html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script>

            function changeColor(str){
                var body = document.getElementById("b");
                body.style.backgroundColor = str;
            }        </script>
    </head>
    <body id="b" >

        <button onclick="changeColor('blue')">蓝色</button>
        <button onclick="changeColor('red')">红色</button>
        <button onclick="changeColor('green')">绿色</button>

    </body></html>

以上就是如何实现网页换肤效果 的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。