Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   Плавное появление блока. (https://javascript.ru/forum/jquery/69470-plavnoe-poyavlenie-bloka.html)

рони 26.06.2017 22:58

Цитата:

Сообщение от maxg5
С картинками такой код HTML

$(function() {
    var parent = $(".gg"),
        title = $(".the_time", parent),
        content = $(".imaage img", parent),
        i = 0,
        len = title.length,
        timer;
    title.each(function(indx, element) {
        $(this).mouseenter(function() {
            i = indx;
            show(true)
        })
    });

    function show(hold) {
        window.clearTimeout(timer);
        title.removeClass("active").eq(i).addClass("active");
        content.hide().eq(i).show();
        if (!hold) {
            i = ++i % len;
            timer = window.setTimeout(show, 3E3)
        }
    }
    show();
    parent.mouseleave(function() {
        show(false)
    })
});

maxg5 26.06.2017 23:12

рони,
Все работает.
Спасибо!


Часовой пояс GMT +3, время: 05:51.