使用.html的背景(内容)

时间:2013-11-09 10:21:37

标签: javascript jquery html5 jquery-mobile dynamic

如何更改此代码中的背景以动态更改?我尝试将整个代码合并到dynamicCodeContainer1中,但没有成功。

<div style="background-color:#000000;height:200px;width:500px;float:left;"
    id="consumed1">
    <div id="dynamicCodeContainer1">no dynamic code loaded.</div>
</div>

以下是完整代码:

<html>
  <head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="jquery.mobile-1.0.1.css">
    <script src="jquery-1.7.1.min.js"></script>
    <script src="jquery.mobile-1.0.min.js"></script>
    <style type="text/css">

<script type="text/javascript">
var refresh = 500;
function init()
{    
    loop(refresh);
}

function loop(x)
{              
    if (MW1002==false)
    {
        var content = '<input type="submit" id="Button1" value="Button1" data-corners="true" data-theme="a" />';
        $('#dynamicCodeContainer1').html(content).trigger("create");
    }
    if (MW1002==true)
    {
        var content = '<input type="submit" id="Button1" value="Button1" data-corners="true" data-theme="b" />';
        $('#dynamicCodeContainer1').html(content).trigger("create");
    }
}
 </script> </head>
 <body onload="init()">
    <script type="text/javascript"></script> 
    <section id="page1" data-role="page">
        <div style="background-color:#000000;height:200px;width:500px;float:left;"
          id="consumed1">
          <div id="dynamicCodeContainer1">no dynamic code loaded.</div>
        </div>
    </section>
</body>
</html>

0 个答案:

没有答案