本帖最后由 Dean_L 于 2011-02-20 15:47:35 编辑

解决方案 »

  1.   

    稍微修改了一下 如果内容不满则不复制第二个层 也不滚动
    因为权限不够 就先跟帖回复在这了/*****************************************************
    函数功能:扩展jQuery方法scrollStart()开始内容滚动。
    创建时间:2011年2月20日
    修改时间:2011年2月20日
    创建人员:李俊杰
    参数说明:speed指滚动速度,隐藏参数二指定间隔滚动速度
    *****************************************************/
    jQuery.fn.extend({

    scrollStart : function (speed){
    if(this.height() < this.children().first().height()){
    this.append("<div></div>");
    this.children().last().html(this.children().first().html());
    this.scrollTop(0);
    function Marquee(Obj){
    if(mySpeed == speed){
    if(Obj.scrollTop() >= Obj.children().first().height() * 2 - Obj.height()){
    Obj.scrollTop(Obj.scrollTop() - Obj.children().first().height());
    }else{
    Obj.scrollTop(parseInt(Obj.scrollTop()) + 1);
    }
    }else{
    var i = 1;
    var myMar_ = window.setInterval(function(){
    if(Obj.scrollTop() >= Obj.children().first().height() * 2 - Obj.height()){
    Obj.scrollTop(Obj.scrollTop() - Obj.children().first().height());
    }else{
    Obj.scrollTop(parseInt(Obj.scrollTop()) + 1);
    i < Obj.height() ? i++ : clearInterval(myMar_);
    }
    }, speed);
    }
    }
    var mySpeed = arguments[1]||speed;
    var e = this;
    var myMar = window.setInterval(function(){Marquee(e);}, mySpeed);

    this.live("mouseover", function(){
    clearInterval(myMar);
    });

    this.live("mouseout", function(){
    myMar = window.setInterval(function(){Marquee(e);}, mySpeed);
    });
    }
    }
    })
      

  2.   


    间隔式滚动的高度 = 外部包裹的DIV的高度
    如果出现意外 有可能是你外部包裹的DIV设置了内间隔
      

  3.   

    学习.还没经验.不会写jquery扩展
      

  4.   

    第二个间隔无缝滚动。有点不大明白。那修改后的是滚动div上面的js吧。但是不滚
      

  5.   

    如果出现意外 有可能是你外部包裹的DIV设置了内间隔
      

  6.   

    学习.还没经验.不会写jquery扩展
      

  7.   

    scrollStart : function (speed){ 
    this.append(" <div> </div>"); 
    this.children().last().html(this.children().first().html()); 
    this.scrollTop(0); 
    function Marquee(Obj){ 
    if(mySpeed == speed){ 
    if(Obj.scrollTop() >= Obj.children().first().height() * 2 - Obj.height()){ 
    Obj.scrollTop(Obj.scrollTop() - Obj.children().first().height()); 
    }else{ 
    Obj.scrollTop(parseInt(Obj.scrollTop()) + 1); 

    }else{ 
    var i = 1; 
    var myMar_ = window.setInterval(function(){ 
    if(Obj.scrollTop() >= Obj.children().first().height() * 2 - Obj.height()){ 
    Obj.scrollTop(Obj.scrollTop() - Obj.children().first().height()); 
    }else{ 
    Obj.scrollTop(parseInt(Obj.scrollTop()) + 1); 
    i < Obj.height() ? i++ : clearInterval(myMar_); 

    }, speed); 


    var mySpeed = arguments[1]||speed; 
    var e = this; 
    var myMar = window.setInterval(function(){Marquee(e);}, mySpeed); this.live("mouseover", function(){ 
    clearInterval(myMar); 
    }); this.live("mouseout", function(){ 
    myMar = window.setInterval(function(){Marquee(e);}, mySpeed); 
    }); 
      

  8.   

    where is the demo online ?
      

  9.   

    jQuery.fn.extend({
    test:function(){
     $(this).click(function(){
     alert($(this).val());
    })
    }})