Javascript Dreamweaver CS6-如何停止鼠标上的滑块?

Javascript Dreamweaver CS6-如何停止鼠标上的滑块?,javascript,jquery,slider,onmouseover,Javascript,Jquery,Slider,Onmouseover,下面是jquery代码。。我想知道,在代码中,当我翻过滑块时,我应该如何以及在哪里输入函数。。然后当我将鼠标移出滑块时,它会继续滑动照片 $(document).ready(function() { $('.photo').hover(function() { $(this) .find('.caption') .stop() .animate({ bottom:

下面是jquery代码。。我想知道,在代码中,当我翻过滑块时,我应该如何以及在哪里输入函数。。然后当我将鼠标移出滑块时,它会继续滑动照片

$(document).ready(function() {

    $('.photo').hover(function() {

        $(this)
            .find('.caption')
            .stop()
            .animate({
                bottom: '0'
            }, {
                duration: 2000,
                easing: 'easeOutQuart'
            });
    }, function() {

        $(this)
            .find('.caption')
            .stop()
            .animate({
                bottom: '-100px'
            }, {
                duration: 2000,
                easing: 'easeOutQuart'
            });

        var interval = setInterval(slideSwitch, 2000);

    });

});
您可以使用jQuery函数作为快捷方式:

$(function() {
    var interval = setInterval( slideSwitch, 10000 );

    $('#slideshow').hover(function() {
        clearInterval(interval);
    }, function() {
        interval = setInterval( slideSwitch, 10000 );
    });
});
这里是一个链接,用于链接