开发者

Jquery Galleria pause and play on hover

开发者 https://www.devze.com 2023-01-02 19:23 出处:网络
I have implemented the jquery Galleria plugin 开发者_运维问答in a website, but would like for it to pause when I hover my mouse over it and play again, when I remove the mouse.

I have implemented the jquery Galleria plugin 开发者_运维问答in a website, but would like for it to pause when I hover my mouse over it and play again, when I remove the mouse.

How can I do this?

Thanks Vayu


You can use the extend function to do that, like this:

$('.images').galleria({
    autoplay: true,
    extend: function() {
        var gallery = this;
        this.$('stage').hover(function() {
            gallery.pause();
        }, function() {
            gallery.play();
        });
    }
});
0

精彩评论

暂无评论...
验证码 换一张
取 消