最近,在做项目的时候遇到点问题。想实现让用户调节网页的某些颜色,用一个dropdownlist
点击dropdownlist弹出,选择颜色的窗口。像在开发环境里选择按钮颜色一样。并把这些信息
写到cookies里。求相应的思路!!!!

解决方案 »

  1.   

    这个可以通过CSS文件来实现。
      

  2.   

    PageOne.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head>
    <body>
    <select id=colorSelecter>
    <OPTION style="BACKGROUND-COLOR: blue" value="blue">蓝色</OPTION>
    <OPTION style="BACKGROUND-COLOR: red" value="red">红色</OPTION>
    <OPTION style="BACKGROUND-COLOR: green" value="green">绿色</OPTION>
    </select>
    <input type=button onclick="OnBtnNewWindow()" value="确定">
    <script language=javascript>
    function OnBtnNewWindow()
    {
    document.cookie="";
    document.cookie=document.getElementById("colorSelecter").value;
    window.open("PageTwo.Htm");
    }
    </script>
    </body>
    </html>PageTwo.htm:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head>
    <body>
    <script language=javascript>
    var bgColor=document.cookie;
    document.body.bgColor=bgColor
    </script>
    </body>
    </html>
      

  3.   

    你可以在数据库中定义这些颜色,然后把它绑定到list上,然后通过后台来定义页面的某些颜色.
    一边做论坛都会用的到,你可以参考一下!
      

  4.   

    snip81说的是对的,而且,不必重新弹出窗口,本窗口的颜色也可以变得