有这种效果的例子吗

解决方案 »

  1.   

    jquery的ui插件里面有 楼主可以找的看看那
      

  2.   

    var Timer = function(hdId,bdId,indexId,Urls){
    var _this = this,tmpA="",arrTemp = 0,arrTempBefore=0,argv=[],isChaochu=false;
    this.tempArray = new Array();
    this.Json2Array = function(){
    if(arguments[0].length<=0){
    _this.$(hdId).parentNode.style.display = "none";
    return false;
    }
    var json = eval("(" + arguments[0] + ")");
    var articleArraySrc = json.Children[0].Children[3].Children;
    var articleArrayObj = new Array();
    var tempDate = "";
    var tempArray = new Array();
    try{
    for (var i=0; i<articleArraySrc.length; i++){
    var time = articleArraySrc[i].Children[7].Children[0]?articleArraySrc[i].Children[7].Children[0].Content:"";
    var title = articleArraySrc[i].Children[1].Children[0]?articleArraySrc[i].Children[1].Children[0].Content:"";
    var Url = articleArraySrc[i].Children[4].Children[0]?articleArraySrc[i].Children[4].Children[0].Content:"";
    var img = articleArraySrc[i].Children[5].Children[0]?articleArraySrc[i].Children[5].Children[0].Content:"";
    var icocode = articleArraySrc[i].Children[9].Children[0]?articleArraySrc[i].Children[9].Children[0].Content:"0";
    var ico="none";
    switch (icocode){
    case "1":
    ico = "pic";
    break;
    case "2":
    case "5":
    ico = "video";
    break;
    case "3":
    ico = "video";
    break;
    default :
    ico = "none";
    }
     
    if(time == "") continue;
    if(tempDate == "" || time.substr(0,10) == tempDate.substr(0,10)){
    tempArray.push({"title":title,"img":img,"ico":ico,"Url":Url});
    tempDate = time;
    }
    else {
    articleArrayObj.push({"time":tempDate,"item":[]});
    for (var j=0; j<tempArray.length; j++ ){
    articleArrayObj[articleArrayObj.length-1].item.push(tempArray[j]);
    }
    tempArray.splice(0,tempArray.length);
    tempArray.push({"title":title,"img":img,"ico":ico,"Url":Url});
    tempDate = time;
    }
    if(i == articleArraySrc.length-1&&tempArray.length>0) articleArrayObj.push({"time":tempDate,"item":tempArray});
    }
    _this.initTemp(eval(articleArrayObj));
    _this.move();
    return articleArrayObj;
    }
    catch (e){
    alert(e);
    }
    };