获取数组最小值

var arr =[123,54,5,111,343];
//获取最小值

Math.min.apply(null,arr);
//获取最大值
Math.max.apply(null,arr);


    var dataint = {'data':[{'src':'24.jpg'},{'src':'25.jpg'},{'src':'26.jpg'},{'src':'27.jpg'},{'src':'28.jpg'},{'src':'29.jpg'},{'src':'30.jpg'},{'src':'31.jpg'},{'src':'32.jpg'},{'src':'33.jpg'},{'src':'34.jpg'},{'src':'35.jpg'},{'src':'36.jpg'},{'src':'37.jpg'},{'src':'38.jpg'}]};


可以获取dataint.data[i].src
var scrolltop = document.body.scrollTo || document.documentElement.scrollTop;  
var clientHeight = document.body.clientHeight || document.documentElement.clientHeight

原生js获取滚动条高度和页面高度都需要兼容

 

posted @ 2015-06-04 00:03  小菜鸡12315  阅读(168)  评论(0编辑  收藏  举报