本帖最后由 qqmnme 于 2014-07-13 20:39:00 编辑

解决方案 »

  1.   

    <script type="text/javascript">
    var json=[
    {"text":"1","src":"/jscss/demoimg/1.jpg","height":"273"},
    {"text":"2","src":"/jscss/demoimg/2.jpg","height":"273"},
    {"text":"3","src":"/jscss/demoimg/3.jpg","height":"306"},
    {"text":"4","src":"/jscss/demoimg/4.jpg","height":"270"},
    {"text":"5","src":"/jscss/demoimg/5.jpg","height":"273"},
    {"text":"6","src":"/jscss/demoimg/6.jpg","height":"307"},
    {"text":"7","src":"/jscss/demoimg/7.jpg","height":"272"},
    {"text":"8","src":"/jscss/demoimg/8.jpg","height":"285"},
    {"text":"9","src":"/jscss/demoimg/9.jpg","height":"303"},
    {"text":"10","src":"/jscss/demoimg/10.jpg","height":"272"},
    {"text":"11","src":"/jscss/demoimg/5.jpg","height":"273"},
    {"text":"12","src":"/jscss/demoimg/7.jpg","height":"273"},
    {"text":"13","src":"/jscss/demoimg/3.jpg","height":"280"}
    ]
    function getSmallDiv(wrap,oD){
    var len=oD.length;
    var h=Infinity;
    var getD;
    for(var i=0;i<len;i++){
    if(oD.eq(i).height()<h){
    h=oD.eq(i).height();
    getD=oD.eq(i);
    }
    }
    return getD;
    }
    $("button").click(function(){
    for(var i=0;i<json.length;i++){
    var str;
    str="<div class=\"content\">";
    str+="<img src="+json[i].src+" height="+json[i].height+" alt=\"\" />";
    str+="<div class=\"imgcaption\">"+json[i].text+"</div>";
    str+="</div>";
    getSmallDiv($(".section"),$(".aside")).append(str);
    }
    });
    </script>看了很多例子,不知道从何下手!
      

  2.   

    瀑布流,有插件可以使用。 你可以网上找找。 自己也可以实现,就是使用ajax来加载html。