0

在这里,我正在运行一个成绩单,该成绩单也突出显示了当前单词。成绩单向上滚动并且文本失去视图时的问题,突出显示也是如此。我想要发生的是,当高光到达框的顶部时,它应该保持在顶线上的视图中,而不会向上消失。你能帮我吗???

function runTransript() {

//var player = _V_('video');
 //var videoCurrentTime = player.currentTime();

var transcriptSpeed = 300; //videoCurrentTime; 

transcriptSpeed *= $("#transcript .full-transcript").parent().height();

$("div").css({ top: $(this).parent().height() + 'px' });
$("div").animate({top: -$(this).height() }, transcriptSpeed, 'linear');
$(".transcript-text").each(function(index){

    var curObj = $(this);
    var interval = $(this).attr('time');

    curObj.delay(interval).animate({color: '#5c9127'}, 100, function() {
        $(this).prev().removeAttr("style").prev().removeAttr("style").prev().removeAttr("style");
    });

});

}

4

1 回答 1

0

函数 runTransript() {

var player = _V_('video'),
    videoCurrentTime = player.currentTime(),
    lineCount = 1,
    transcriptSpeed = videoCurrentTime;

transcriptSpeed *= $("#transcript .full-transcript").parent().height();

$("div").css({ top: $(this).parent().height() + 'px' });
$("div").each(function(index){

    var curObj = $(this);
    var interval = $(this).attr('time');

    curObj.delay(interval).animate({color: '#f0e53d'}, 100, function() {

        var pos = $(this).position();
        console.log(pos.left);
        if(parseInt(pos.left) == 15 && index > 0){
            $("div").delay(2000).animate({top: "-"+parseInt(lineCount*35)+"px" }, 'slow', 'linear');
            lineCount++;
        } 
        $(this).addClass('active').prev().removeClass('active').removeAttr("style");
    });

});

}

于 2012-06-15T20:33:59.810 回答