开发者

uniform, change style in another file

开发者 https://www.devze.com 2023-01-19 17:38 出处:网络
i have this site structure: First page: <script src=\"../jquery.uniform.min.js\" typ开发者_StackOverflowe=\"text/javascript\" charset=\"utf-8\"></script>

i have this site structure:

First page:

    <script src="../jquery.uniform.min.js" typ开发者_StackOverflowe="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
      $(function(){
        $("input, textarea, select, button").uniform();

        $("#show_image_error").load("adv_dell_img_err.html?id="+ Math.random());
      });
    </script>
    <link rel="stylesheet" href="../css/uniform.default.css" type="text/css" media="screen">
  </head>
  <body>
  In first page:<br/>
    <select>
        <option>Through Google</option>
        <option>Through Twitter</option>
        <option>Other&hellip;</option>
    </select>
    <div id = "show_image_error">load file ...</div>

adv_dell_img_err.html file:

File 2
//get data from DB ...
<select>
    <option>Through Google</option>
    <option>Through Twitter</option>
    <option>Other&hellip;</option>
</select>

Why uniform in adv_dell_img_err.html no't work? How fix them?

Thanks


Try changing this:

$(function(){
        $("input, textarea, select, button").uniform();

        $("#show_image_error").load("adv_dell_img_err.html?id="+ Math.random());
      });

to this:

     $(function(){
        $("#show_image_error").load(
             "adv_dell_img_err.html?id="+ Math.random(), 
             function(responseText, textStatus, XMLHttpRequest) {
                 $("input, textarea, select, button").uniform();
             }
         );
      });

I think that the problem is that when uniform executes the content was not yet loaded.

0

精彩评论

暂无评论...
验证码 换一张
取 消