jQuery(function($) {
//    var menuYloc = $(".div-scroll").offset().top;
//    $(window).scroll(function (){ 
//        var offsetTop = menuYloc + $(window).scrollTop() +"px";
//        $(".div-scroll").animate({top : offsetTop },{ duration:50 , queue:false });
//    });
    
    var randomGroup = [ $('.section01'), $('.section02'), $('.section03') ],
    current;
    
    for(var i = 0; i < 3; i++){
        current = randomGroup.splice(Math.floor(Math.random() * randomGroup.length), 1);
        
        current[0].prependTo('.wraper');
    }
});

.wraper中会随机排列section01到section03。

posted on 2014-01-21 16:47  meeming  阅读(238)  评论(0)    收藏  举报



Fork me on GitHub