首页  >  文章  >  web前端  >  如何实现网页换肤效果

如何实现网页换肤效果

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


网页换肤效果

简单的换肤
蓝    红   绿

<!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(&#39;blue&#39;)">蓝色</button>
        <button onclick="changeColor(&#39;red&#39;)">红色</button>
        <button onclick="changeColor(&#39;green&#39;)">绿色</button>

    </body></html>

以上是如何实现网页换肤效果 的详细内容。更多信息请关注PHP中文网其他相关文章!

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