Coder Social home page Coder Social logo

waterfall's Issues

使用瀑布流的一些疑问~

使用waterfall时碰到一些疑问,各位大牛有空的话希望能帮忙解答一下^_^

从数据库读数据转换成json显示到页面,我做了以下几个改动

1,DEBUG_DATA = ['{"data":{"blogs":${json}....
将blogs后面的数据换为json

2,将masnunit.js中的TEMPLATES进行了改动,以符合我的json数据格式

3,将页面中多余的form这些删掉

现在碰到的问题是
1,页面往下拉的时候,数据不能加载出来,加载之后就显示分页的div了,下一页的内容显示不出来
2,往下滚动的时候 去调用的哪个方法将数据填充到下面的呢

如果从数据动态读数据 有示例吗?

麻烦了~

如何组成endless 的分页,滚动到底部自动加载

如何组成endless 的分页,滚动到底部自动加载, 我尝试改大'subpagenum': 20, 结果一页就记载了好多东西, 我想要一屏少点东西, 需要的时候再多加载些。现在改大后一开始就加载过多的东西。 有什么配置能实现好一点的滚动分页呢?

后台返回参数一定要带图片宽度和高度吗?

我现在后台只传了图片url过来,前端写死每个图片的宽度,高度根据图片情况自适应。
现在有一个问题就是图片还没加载完成的时候,页面已经渲染了div的宽高,等到图片加载完,布局已经没法改变了,出现图片重叠的情况。
问:有没有办法不传高度宽度情况下解决这个问题?

如何更好地自定义单元样式

在ANALYZERESPONSE新建了一个组装方式,自定义了单元样式(复制第二种)。
code如下
function (h){
var strrt = _strReturn(h);
if( strrt ){
return strrt;
}

        var ret = [[],true];


        // 转json对象
        try{
            var jsn = $.isPlainObject(h) ? h : $.parseJSON(h)
        }catch(e){
            console.log(e)
            // 如果parse 失败,直接返回初始状态的 ret;
            return ret;
        }

        // 判断jsn 请求是否成功返回数据
        if(jsn.success){
            var $rt = $(null),
                dat = jsn.data;
            for(var i=0,d=dat.theme,l=d.length; i<l; i++){
                var unt = [

                        '<div class="woo col-xs-4 col-md-4 zt-container" >' 
                        +'<div ><img class="featurette-image img-responsive" src="data:image/png;base64," data-src="holder.js/500x500/auto" alt="Generic placeholder image"></div>'
                        +'<div class="carousel-caption zt-title"><h1>专题名称</h1><p>专题解说</p></div>'
                        +'<div class="zt-detail"><p>共有<span>116</span>篇文章,8分钟前更新</p></div>'
                        +'</div>'

                    ].join('')

                $rt = $rt.add($(unt))
            }
            ret = [$rt.toArray(),dat.has_next]
        }
        return ret;
    }

但是当在页面显示出来时,会比我自定义的单元框多了少少样式代码,导致与页面样式很看。如何更好的自定义自己的单元样式呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.