解决方案 »

  1.   

    具体查看下ajax是否返回div数据成功
      

  2.   

    ajax 回调函数中
    $('#d_content').find('#指定id')....
      

  3.   

    ajax返回的数据已经显示出来了,还有那个find()函数我也用了 ,都不行,对了,忘记说了一点,Ajax返回的值是在jquery的html()里面的,变成innerHTML也还取不到代码不能外漏啊 ,真抱歉
      

  4.   

    $("#sel_list").change(function(){
    $.get("/shop/showphotos", {album_id:$("#sel_list").val()}, function(dt){
    document.getElementById("d_content").innerHTML = dt;
    },"html"); });
      

  5.   

    $("#sel_list").change(function(){
      $.get("/shop/showphotos", {album_id:$("#sel_list").val()}, function(dt) {
        $('#d_content').html(dt);
        $('#d_content').find('...').css(...);
      },"html");
    });
      

  6.   

    相对完整的测试例<?php
    if($_POST) {
      exit('<div id=p>aaa</div><div id=p1>bbb</div>');
    }
    ?>
    <script src=scripts/jquery-1.8.3.min.js></script>
    <script>
    $(function() {
      $.post('<?=$_SERVER['PHP_SELF'];?>', {id:1}, function(d) {
        $('#view').html(d).find('#p').css('color', '#f00');
      });
    })
    </script>
    <div id=view></div>
      

  7.   

    还是不行,我想要鼠标悬浮的样式  按你的办法走了 还是没反映,就取不到那个ID  JS文件路径什么的肯定对  因为这个JS文件里还有别的 ,都可以,就这个取不到
      

  8.   

    这个就是真实的AJAX代码,还有,我想取的是ID下的一个Class  真的很谢谢你。我在firebug里看到那些AJAX返回的代码了  ,都没问题。
      

  9.   

    <div id="d_content" style="width:500px;height:270px;margin-top:5px;overflow:auto;"></div>    这是phtml代码的,用的Zend框架   返回的数据都在这里面
      

  10.   

    <div id="d_content" style="width:500px;height:270px;margin-top:5px;overflow:auto;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
       <div class="pic_box1" style="width:140px;height:100px;margin:9px;float:left;border:1px #ffffff solid;">
    </div>这是firebug下看到的返回的数据   就取那个  class="pic_box1"
      

  11.   

    $('.pic_box1') 得到的是一个数组。
    你还需要在each 中单独处理,当然整体设置也是可以的
      

  12.   

    麻烦你帮我解决下好吗,我不知道那个each怎么用的
      

  13.   

    对了,我之前用的就是这个代码,$()按你说的取的也是一个数组,但是没有each处理也能出效果,那些数据是在HTML页面的,这个是因为现在这些数据是AJAX返回的么?
      

  14.   

    现在这个AJAX返回的是 一些图片,这些图片由DIV包着,设margin:5px;我就想设置鼠标放在这些图片上的时候,有那种选中的效果,比如让DIV的border显示并且加个背景颜色
      

  15.   

     解决了,方法是对的,但是我忽略  ajax的同步异步请求了,这个东西在这需要同步一下的