繁体   English   中英

获得柔滑流畅的选框以在鼠标悬停在一个以上区域时停止/开始

[英]Getting silky smooth marquee to stop/start on mouseover/out on more than one area

我在页面上使用了丝质光滑选取框,到目前为止效果很好,但是我需要添加一点:当我将光标悬停在滚动条上时可以停止选取框,而当不悬停时可以重新启动在上面。

滚动条是javascript: http : //n-son.com/scripts/jsScrolling/ 包含滚动条的div具有Scrollbar-Track类。 这是我当前的版本:

http://www.palosverdes.com/sandbox/soverflow/index.cfm

我试图定制现有的jquery函数,但到目前为止我还没有运气。 功能如下:

$('div.demo marquee').marquee('pointer').mouseover(function () {
        $(this).trigger('stop');
    }).mouseout(function () {
        $(this).trigger('start');
    }).mousemove(function (event) {
        if ($(this).data('drag') == true) {
            this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
        }
    }).mousedown(function (event) {
        $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
    }).mouseup(function () {
        $(this).data('drag', false);
    });
});

您可以像将侯爵一样尝试将mouseover / out事件添加到滚动条。 像这样:

$("#scrollbar").mouseover(function(){
    $('div.demo marquee').trigger('stop');
)};

$("#scrollbar").mouseout(function(){
    $('div.demo marquee').trigger('start');
)};

您可以使用与侯爵夫人本身的mouseover事件相同的方式触发事件,但是可以通过滚动条的mouseover / out事件来触发。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM